• thinkphp5 + vue nginx配置


    thinkphp5 + vue 配置

    server {
    
        listen 80;
        listen [::]:80;
    
        # For https
        listen 443 ssl;
        listen [::]:443 ssl;
        ssl_certificate /etc/nginx/ssl/xxx.pem;
        ssl_certificate_key /etc/nginx/ssl/xxx.key;
        if ($scheme = 'http')
        {
            return 301 https://$server_name$request_uri;
        }
    
        #auth
        auth_basic on;
        auth_basic_user_file /etc/nginx/ssl/.auth;
    
        #gzip
        gzip on;
        gzip_comp_level 6;
        gzip_min_length 1024;
        gzip_buffers 32 4K;
        gzip_types application/javascript text/css;
      
        server_name xxx;
    root /var/www/xxx/dist; index index.php index.html index.htm; # For vue location
    / { try_files $uri $uri/ /index.html; } location ~* .(jpg|jpeg|png|gif|js|css|mtn)$ { expires 1d; } # For thinkphp5 location ~ ^/api/ { if (!-e $request_filename) { rewrite ^/api/(.*)$ /index.php?s=/$1 last; } } location ~ .php$ { root /var/www/xxx/php/public; fastcgi_pass php-upstream; fastcgi_index index.php; fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fixes timeouts fastcgi_read_timeout 600; include fastcgi_params; } location ~ /.ht { deny all; } location /.well-known/acme-challenge/ { root /var/www/letsencrypt/; log_not_found off; } error_log /var/log/nginx/xxx_error.log; access_log /var/log/nginx/xxx_access.log; }

    vue部分还可以:

    if (!-d $request_filename) {
      rewrite ^/(.+)/$ /$1 permanent;
    }

  • 相关阅读:
    (转)Python中的__init__和__new__
    PEP8
    python lstrip()函数
    python中的生成器跟迭代器
    callback
    关于0.0.0.0这个ip的疑问
    Python import中相对路径的问题
    python读取excel
    git本地管理多个密钥/账户
    词法分析之有确定、不确定自动机及其生成器
  • 原文地址:https://www.cnblogs.com/cshaptx4869/p/11737825.html
Copyright © 2020-2023  润新知