Guest User

nginx template

a guest
Aug 12th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. #=======================================================================#
  2. # Default Web Domain Template #
  3. # DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
  4. #=======================================================================#
  5.  
  6. server {
  7. listen %ip%:%proxy_ssl_port% ssl http2;
  8. server_name %domain_idn% %alias_idn%;
  9. ssl_certificate %ssl_pem%;
  10. ssl_certificate_key %ssl_key%;
  11. ssl_stapling on;
  12. ssl_stapling_verify on;
  13. error_log /var/log/%web_system%/domains/%domain%.error.log error;
  14.  
  15. include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
  16.  
  17. location / {
  18. proxy_pass https://%ip%:%web_ssl_port%;
  19. location ~* ^.+\.(%proxy_extentions%)$ {
  20. root %sdocroot%;
  21. access_log /var/log/%web_system%/domains/%domain%.log combined;
  22. access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
  23. expires max;
  24. try_files $uri @fallback;
  25. }
  26. location /ytdl/ {
  27. proxy_set_header X-Real-IP $remote_addr;
  28. proxy_set_header X-Forwarded-For $remote_addr;
  29. proxy_set_header Host $host;
  30. proxy_pass http://127.0.0.1:17442/;
  31. max_ranges 0;
  32. }
  33. location /wh/ {
  34. proxy_set_header X-Real-IP $remote_addr;
  35. proxy_set_header X-Forwarded-For $remote_addr;
  36. proxy_set_header Host $host;
  37. proxy_pass http://127.0.0.1:5001/;
  38. max_ranges 0;
  39. }
  40. }
  41.  
  42. location /error/ {
  43. alias %home%/%user%/web/%domain%/document_errors/;
  44. }
  45.  
  46. location @fallback {
  47. proxy_pass https://%ip%:%web_ssl_port%;
  48. }
  49.  
  50. location ~ /\.ht {return 404;}
  51. location ~ /\.svn/ {return 404;}
  52. location ~ /\.git/ {return 404;}
  53. location ~ /\.hg/ {return 404;}
  54. location ~ /\.bzr/ {return 404;}
  55.  
  56. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  57. }
  58.  
  59.  
Add Comment
Please, Sign In to add comment