美文网首页
关于nginx配置

关于nginx配置

作者: 倩仔6 | 来源:发表于2020-06-02 09:15 被阅读0次
    #user  root;
    worker_processes  1;
    error_log  /var/log/nginx/error.log warn;
    pid        /var/run/nginx.pid;
    events {
        worker_connections  1024;
    }
    http {
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                         '$status $body_bytes_sent "$request_body" "$http_referer" "$http_token" '
                         '"$http_user_agent" "$http_x_forwarded_for"';
        access_log  /var/log/nginx/access.log  main;
        sendfile        on;
        #tcp_nopush     on;
        keepalive_timeout  65;
        #gzip  on;
        server {
            listen       8080;
            server_name  localhost;
            client_max_body_size 200M;
    
            location /h5 {
                root   /usr/share/nginx/html;
                index  index.html index.htm;
                try_files $uri $uri/ /index.html;
            }
            
             location  /api/ {
                      proxy_pass  http://zmjk-admin-uat.tp:8080/;
                  #uat
                # proxy_pass  http://zmjk-server-admin-prd.tp:8080/;
                   #prd
            }
    
            location / {
                root   /usr/share/nginx/html;
                index  index.html index.htm;
                try_files $uri $uri/ /index.html;
                add_header Access-Control-Allow-Origin *;
            }
    
            location /MP_verify_NPDGyJeh3NHdDQW3.txt {
                 root   /usr/share/nginx/html;
                 index  index.html index.htm;
            }
    
        }
        include /etc/nginx/conf.d/*.conf;
    }
    
    

    相关文章

      网友评论

          本文标题:关于nginx配置

          本文链接:https://www.haomeiwen.com/subject/icmyzhtx.html