Nginx配置代理

server {
    server_name theo.zhaoxxnbsp.com;
    listen 80;
    listen 443 ssl http2;
    index index.html;

#    access_log /var/log/nginx/theo.access.log;
#    error_log /var/log/nginx/theo.error.log;

    location / {
#        include cors.inc.conf;
#        if ($http_origin) {
#         add_header 'Access-Control-Allow-Origin' $http_origin;
#          add_header 'Access-Control-Allow-Credentials' true;
#        }
#
#        if ($request_method = OPTIONS) {
#          add_header 'Access-Control-Allow-Origin' $http_origin;
#          add_header 'Access-Control-Allow-Credentials' true;
#          add_header 'Access-Control-Max-Age' 864000;
#          add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS, PATCH';
#          add_header 'Access-Control-Allow-Headers' '*, Content-Type, Origin, X-Mby20, X-Requested-With,userId,brandId,accessToken,Authorization,appVersion,deviceName,systemName,token';
#          add_header 'Content-Length' 0;
#          add_header 'Content-Type' 'text/plain, charset=utf-8';
#          return 204;
#        }

        proxy_pass http://localhost:5000;
    }
}

原文地址:https://www.cnblogs.com/zhaoxxnbsp/p/13292187.html