1. #wiki.521php.com
  2. server
  3. {
  4. listen 80;
  5. server_name wiki.521php.com;
  6. rewrite ^(.*)$ https://$host$1 permanent;
  7. }
  8. server {
  9. listen 443 ssl;
  10. ssl_certificate /home/cert/wiki.521php.com.crt;
  11. ssl_certificate_key /home/cert/wiki.521php.com.key;
  12. server_name wiki.demo.com wiki.521php.com;
  13. # location ~ .*\.(ttf|woff2|eot|otf|map|swf|svg|gif|jpg|jpeg|bmp|png|ico|txt|js|css)$ {
  14. # #此处将路径执行 MinDoc 的跟目录
  15. # root /usr/share/nginx/mindoc;
  16. # expires 30m;
  17. # }
  18. access_log /var/log/nginx/wiki.521php.com.log access;
  19. # 这里为具体的服务代理配置
  20. location @backend {
  21. proxy_set_header X-Forwarded-For $remote_addr;
  22. proxy_set_header Host $http_host;
  23. proxy_set_header X-Forwarded-Proto $scheme;
  24. #此处配置 MinDoc 程序的地址和端口号
  25. proxy_pass http://521php_centos7:8282;
  26. }
  27. location / {
  28. try_files /_not_exists_ @backend;
  29. }
  30. }