首页 > 其他 > 详细

Nginx配置代理

时间:2020-07-13 12:02:58      阅读:53      评论:0      收藏:0      [点我收藏+]
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;
    }
}

Nginx配置代理

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!