nginx_jimv.conf 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. server {
  2. listen 80;
  3. server_name jimv.your-domain;
  4. access_log /var/log/nginx/jimv.access.log;
  5. error_log /var/log/nginx/jimv.error.log;
  6. # listen 443;
  7. # ssl on;
  8. # ssl_certificate /etc/jimv/keys/jimv.your.crt;
  9. # ssl_certificate_key /etc/jimv/keys/jimv.your.key;
  10. # ssl_session_cache shared:le_nginx_SSL:1m;
  11. # ssl_session_timeout 1440m;
  12. # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  13. # ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
  14. # ssl_prefer_server_ciphers on;
  15. root /usr/local/JimV-C;
  16. # 拒绝访问隐藏文件(如:.git、.svn等目录)
  17. location ~ /\..* {
  18. return 403;
  19. }
  20. location ~ .(sql|py|pyc|ini|conf|log|svn|git|cfg)$ {
  21. return 403;
  22. }
  23. location / {
  24. try_files $uri @inner;
  25. }
  26. location @inner {
  27. proxy_pass http://127.0.0.1:8008;
  28. proxy_redirect off;
  29. proxy_set_header Host $host;
  30. proxy_set_header X-Real-IP $remote_addr;
  31. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  32. }
  33. # Redirect non-https traffic to https
  34. # if ($scheme != "https") {
  35. # return 301 https://$host$request_uri;
  36. # }
  37. }
  38. }