关于nginx配置

#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配置)