码迷,mamicode.com
首页 > 其他好文 > 详细

简单纪要:nginx配置

时间:2019-10-10 15:52:21      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:mon   latest   pack   ons   over   web   resources   control   modified   

/export/servers/nginx/conf/domains/ test1.jd.local

upstream tomcat_live1 {
server 127.0.0.1:1601 weight=10 max_fails=2 fail_timeout=30s ;

}

server {
listen 80;
server_name nihao.local nihao.com  127.0.0.1;
access_log /export/servers/nginx/logs/test1.jd.local/test1.jd.local_access.log main;
error_log /export/servers/nginx/logs/test1.jd.local/test1.jd.local_error.log warn;


error_page 411 = @my_error;

location @my_error {
}
root /export/Packages/vd-live-web/latest/;

location / {
add_header Access-Control-Allow-Origin $http_origin;
add_header Access-Control-Allow-Methods ‘GET, POST, OPTIONS‘;
add_header Access-Control-Allow-Headers ‘DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization‘;
add_header Access-Control-Allow-Credentials true;
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://tomcat_live1;
include /export/servers/nginx/conf/error/error_location.conf;
expires 0;
}

location ~ ^/(monitor|resources)/* {
proxy_pass http://127.0.0.1:1601;
include /export/servers/nginx/conf/error/error_location.conf;
}

location /logs/ {
autoindex off;
deny all;
}
location /l/uploadCoverPC {
log_not_found off;
}
include /export/servers/nginx/conf/error/error.conf;
}

简单纪要:nginx配置

标签:mon   latest   pack   ons   over   web   resources   control   modified   

原文地址:https://www.cnblogs.com/Rnan/p/11648038.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!