# HTTPS
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
# https ssl
ssl_certificate ssl/3889366_lmsite.cn.pem;
ssl_certificate_key ssl/3889366_lmsite.cn.key;
include ssl/ssl_config.conf;
server_name lmsite.cn www.lmsite.cn;
access_log /data/weblogs/lmsite.cn_nginx.log combined;
#error_page 404 /404.html;
#error_page 502 /502.html;
# 精准匹配
location / {
index index.html index.htm index.php index.jsp;
root /webroot/lmsite.cn;
}
# 代理 spug
location /spug/ {
include proxy_set_header.conf;
proxy_pass http://127.0.0.1:28080/;
}
# 代理 status
location /status/ {
include proxy_set_header.conf;
proxy_pass http://127.0.0.1:61208/;
}
# 静态资源
#location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
# expires 30d;
# access_log off;
#}
# css/js
#location ~ .*\.(js|css)?$ {
# expires 7d;
# access_log off;
#}
# 限制访问的文件
location ~ /(\.user\.ini|\.ht|\.git|\.svn|\.project|LICENSE|README\.md) {
deny all;
}
}
# http rewrite https
server {
listen 80;
listen [::]:80;
server_name lmsite.cn www.lmsite.cn;
rewrite ^(.*)$ https://${server_name}$1 permanent;
}