1. # HTTPS
    2. server {
    3. listen 443 ssl http2;
    4. listen [::]:443 ssl http2;
    5. # https ssl
    6. ssl_certificate ssl/3889366_lmsite.cn.pem;
    7. ssl_certificate_key ssl/3889366_lmsite.cn.key;
    8. include ssl/ssl_config.conf;
    9. server_name lmsite.cn www.lmsite.cn;
    10. access_log /data/weblogs/lmsite.cn_nginx.log combined;
    11. #error_page 404 /404.html;
    12. #error_page 502 /502.html;
    13. # 精准匹配
    14. location / {
    15. index index.html index.htm index.php index.jsp;
    16. root /webroot/lmsite.cn;
    17. }
    18. # 代理 spug
    19. location /spug/ {
    20. include proxy_set_header.conf;
    21. proxy_pass http://127.0.0.1:28080/;
    22. }
    23. # 代理 status
    24. location /status/ {
    25. include proxy_set_header.conf;
    26. proxy_pass http://127.0.0.1:61208/;
    27. }
    28. # 静态资源
    29. #location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
    30. # expires 30d;
    31. # access_log off;
    32. #}
    33. # css/js
    34. #location ~ .*\.(js|css)?$ {
    35. # expires 7d;
    36. # access_log off;
    37. #}
    38. # 限制访问的文件
    39. location ~ /(\.user\.ini|\.ht|\.git|\.svn|\.project|LICENSE|README\.md) {
    40. deny all;
    41. }
    42. }
    43. # http rewrite https
    44. server {
    45. listen 80;
    46. listen [::]:80;
    47. server_name lmsite.cn www.lmsite.cn;
    48. rewrite ^(.*)$ https://${server_name}$1 permanent;
    49. }