Advertisement
Guest User

Untitled

a guest
Aug 11th, 2016
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. #user 'example' virtual host 'example.ru' configuration file
  2.  
  3. server {
  4. server_name www.example.ru;
  5. return 301 $scheme://example.ru$request_uri;
  6. }
  7. server {
  8. server_name example.ru;
  9. charset off;
  10. disable_symlinks if_not_owner from=$root_path;
  11. index index.html index.php;
  12. root $root_path;
  13. set $root_path /var/www/example/data/www/example.ru;
  14. access_log /var/www/httpd-logs/example.ru.access.log ;
  15. error_log /var/www/httpd-logs/example.ru.error.log notice;
  16. include /etc/nginx/vhosts-includes/*.conf;
  17. include /etc/nginx/vhosts-resources/example.ru/*.conf;
  18. location / {
  19. #limit_conn addr 3;
  20. location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
  21. try_files $uri $uri/ @fallback;
  22. expires 30m;
  23. }
  24. location / {
  25. try_files /does_not_exists @fallback;
  26. }
  27. location ~ [^/]\.ph(p\d*|tml)$ {
  28. try_files /does_not_exists @fallback;
  29. }
  30. }
  31. location @fallback {
  32. proxy_pass http://127.0.0.1:8080;
  33. proxy_redirect http://127.0.0.1:8080 /;
  34. proxy_set_header Host $host;
  35. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  36. proxy_set_header X-Forwarded-Proto $scheme;
  37. access_log off ;
  38. }
  39. ssi on;
  40. listen IP_ADDRESS:80;
  41. return 301 https://example.ru:443$request_uri;
  42. }
  43. server {
  44. server_name example.ru;
  45. charset off;
  46. disable_symlinks if_not_owner from=$root_path;
  47. index index.html index.php;
  48. root $root_path;
  49. set $root_path /var/www/example/data/www/example.ru;
  50. access_log /var/www/httpd-logs/example.ru.access.log ;
  51. error_log /var/www/httpd-logs/example.ru.error.log notice;
  52. include /etc/nginx/vhosts-includes/*.conf;
  53. include /etc/nginx/vhosts-resources/example.ru/*.conf;
  54. location / {
  55. #limit_conn addr 3;
  56. location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
  57. try_files $uri $uri/ @fallback;
  58. expires 30m;
  59. }
  60. location / {
  61. try_files /does_not_exists @fallback;
  62. }
  63. location ~ [^/]\.ph(p\d*|tml)$ {
  64. try_files /does_not_exists @fallback;
  65. }
  66. }
  67. location @fallback {
  68. proxy_pass http://127.0.0.1:8080;
  69. proxy_redirect http://127.0.0.1:8080 /;
  70. proxy_set_header Host $host;
  71. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  72. proxy_set_header X-Forwarded-Proto $scheme;
  73. access_log off ;
  74. }
  75. ssi on;
  76. add_header Strict-Transport-Security "max-age=31536000;";
  77. listen IP_ADDRESS:443;
  78. ssl on;
  79. ssl_certificate "/var/www/httpd-cert/example/example.ru.crtca";
  80. ssl_certificate_key "/var/www/httpd-cert/example/example.ru.key";
  81. ssl_ciphers ********************** // hide;
  82. ssl_prefer_server_ciphers on;
  83. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement