nginx配置参考

server {
listen 443 ssl;
server_name apps.qimeng.fm;
#charset koi8-r;

#证书
ssl_certificate /usr/local/nginx/conf/qimeng.pem;
ssl_certificate_key /usr/local/nginx/conf/qimeng.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;


access_log /data/log/nginx/apps.qimeng.fm/access.log main;
error_log /data/log/nginx/apps.qimeng.fm/error.log;


location ~ ^/NginxStatus/ {
stub_status on; #Nginx 状态监控配置
access_log off;
}
location ~ ^/(WEB-INF)/ {
deny all;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

#if ( $host != 'boss.7mtt.cn') {
# return 403;
# }

# 图片服务
location /appsimg {
alias /data/www/appsfile/
}

#api服务
location / {
if ($request_uri ~* "setup.php") {
return 500 "error";
}

client_max_body_size 10m;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
proxy_connect_timeout 240;
proxy_send_timeout 240;
proxy_read_timeout 240;
# note, there is not SSL here! plain HTTP is used
proxy_pass http://127.0.0.1:8011;
}
}

有追求,才有动力!

向每一个软件工程师致敬!

by wujf

mail:921252375@qq.com

原文地址:https://www.cnblogs.com/wujf/p/10682180.html