Advertisement
Guest User

Untitled

a guest
Oct 14th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.56 KB | None | 0 0
  1. #user 'domain' virtual host 'domain.ru' configuration file
  2.  
  3. server {
  4. server_name www.domain.ru;
  5. charset off;
  6. disable_symlinks if_not_owner from=$root_path;
  7. index index.html index.php;
  8. root $root_path;
  9. set $root_path /var/www/domain/data/www/domain.ru;
  10. access_log /var/www/httpd-logs/domain.ru.access.log ;
  11. error_log /var/www/httpd-logs/domain.ru.error.log notice;
  12. include /etc/nginx/vhosts-includes/*.conf;
  13. include /etc/nginx/vhosts-resources/domain.ru/*.conf;
  14. location / {
  15. #limit_conn addr 3;
  16. location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
  17. try_files $uri $uri/ @fallback;
  18. expires 30m;
  19. }
  20. location / {
  21. try_files /does_not_exists @fallback;
  22. }
  23. location ~ [^/]\.ph(p\d*|tml)$ {
  24. try_files /does_not_exists @fallback;
  25. }
  26. }
  27. location @fallback {
  28. proxy_pass http://127.0.0.1:8080;
  29. proxy_redirect http://127.0.0.1:8080 /;
  30. proxy_set_header Host $host;
  31. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  32. proxy_set_header X-Forwarded-Proto $scheme;
  33. access_log off ;
  34. }
  35. ssi on;
  36. listen 185.60.135.210:80;
  37. return 301 https://domain.ru:443$request_uri;
  38. }
  39.  
  40. server {
  41. server_name domain.ru www.domain.ru;
  42. charset off;
  43. disable_symlinks if_not_owner from=$root_path;
  44. index index.html index.php;
  45. root $root_path;
  46. set $root_path /var/www/domain/data/www/domain.ru;
  47. access_log /var/www/httpd-logs/domain.ru.access.log ;
  48. error_log /var/www/httpd-logs/domain.ru.error.log notice;
  49. include /etc/nginx/vhosts-includes/*.conf;
  50. include /etc/nginx/vhosts-resources/domain.ru/*.conf;
  51. location / {
  52. #limit_conn addr 3;
  53. location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
  54. try_files $uri $uri/ @fallback;
  55. expires 30m;
  56. }
  57. location / {
  58. try_files /does_not_exists @fallback;
  59. }
  60. location ~ [^/]\.ph(p\d*|tml)$ {
  61. try_files /does_not_exists @fallback;
  62. }
  63. }
  64. location @fallback {
  65. proxy_pass http://127.0.0.1:8080;
  66. proxy_redirect http://127.0.0.1:8080 /;
  67. proxy_set_header Host $host;
  68. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  69. proxy_set_header X-Forwarded-Proto $scheme;
  70. access_log off ;
  71. }
  72. ssi on;
  73. rewrite ^(/uploads/.*)$ $1 break;
  74. listen 185.60.135.210:80;
  75. return 301 https://$host:443$request_uri;
  76. }
  77.  
  78. server {
  79. server_name www.domain.ru;
  80. charset off;
  81. disable_symlinks if_not_owner from=$root_path;
  82. index index.html index.php;
  83. root $root_path;
  84. set $root_path /var/www/domain/data/www/domain.ru;
  85. access_log /var/www/httpd-logs/domain.ru.access.log ;
  86. error_log /var/www/httpd-logs/domain.ru.error.log notice;
  87. include /etc/nginx/vhosts-includes/*.conf;
  88. include /etc/nginx/vhosts-resources/domain.ru/*.conf;
  89. location / {
  90. #limit_conn addr 3;
  91. location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
  92. try_files $uri $uri/ @fallback;
  93. expires 30m;
  94. }
  95. location / {
  96. try_files /does_not_exists @fallback;
  97. }
  98. location ~ [^/]\.ph(p\d*|tml)$ {
  99. try_files /does_not_exists @fallback;
  100. }
  101. }
  102. location @fallback {
  103. proxy_pass http://127.0.0.1:8080;
  104. proxy_redirect http://127.0.0.1:8080 /;
  105. proxy_set_header Host $host;
  106. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  107. proxy_set_header X-Forwarded-Proto $scheme;
  108. access_log off ;
  109. }
  110. ssi on;
  111. add_header Strict-Transport-Security "max-age=31536000;";
  112. listen 185.60.135.210:443;
  113. ssl on;
  114. ssl_certificate "/var/www/httpd-cert/domain/domain.ru.crtca";
  115. ssl_certificate_key "/var/www/httpd-cert/domain/domain.ru.key";
  116. ssl_ciphers ****************************;
  117. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  118. ssl_prefer_server_ciphers on;
  119. ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
  120. ssl_session_cache shared:SSL:10m;
  121. ssl_session_tickets off; # Requires nginx >= 1.5.9
  122. ssl_stapling on; # Requires nginx >= 1.3.7
  123. ssl_stapling_verify on; # Requires nginx => 1.3.7
  124. add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
  125. add_header X-Frame-Options DENY;
  126. add_header X-Content-Type-Options nosniff;
  127.  
  128. return 301 https://domain.ru$request_uri ;
  129. }
  130.  
  131. server {
  132. server_name domain.ru www.domain.ru;
  133. charset off;
  134. disable_symlinks if_not_owner from=$root_path;
  135. index index.html index.php;
  136. root $root_path;
  137. set $root_path /var/www/domain/data/www/domain.ru;
  138. access_log /var/www/httpd-logs/domain.ru.access.log ;
  139. error_log /var/www/httpd-logs/domain.ru.error.log notice;
  140. include /etc/nginx/vhosts-includes/*.conf;
  141. include /etc/nginx/vhosts-resources/domain.ru/*.conf;
  142. location / {
  143. #limit_conn addr 3;
  144. location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
  145. try_files $uri $uri/ @fallback;
  146. expires 30m;
  147. }
  148. location / {
  149. try_files /does_not_exists @fallback;
  150. }
  151. location ~ [^/]\.ph(p\d*|tml)$ {
  152. try_files /does_not_exists @fallback;
  153. }
  154. }
  155. location @fallback {
  156. proxy_pass http://127.0.0.1:8080;
  157. proxy_redirect http://127.0.0.1:8080 /;
  158. proxy_set_header Host $host;
  159. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  160. proxy_set_header X-Forwarded-Proto $scheme;
  161. access_log off ;
  162. }
  163.  
  164. ssi on;
  165.  
  166. rewrite ^(/uploads/.*)$ $1 break;
  167.  
  168. add_header Strict-Transport-Security "max-age=31536000;";
  169. listen 185.60.135.210:443;
  170. ssl on;
  171. ssl_certificate "/var/www/httpd-cert/domain/domain.ru.crtca";
  172. ssl_certificate_key "/var/www/httpd-cert/domain/domain.ru.key";
  173. ssl_ciphers ****************************;
  174. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  175. ssl_prefer_server_ciphers on;
  176. ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
  177. ssl_session_cache shared:SSL:10m;
  178. ssl_session_tickets off; # Requires nginx >= 1.5.9
  179. ssl_stapling on; # Requires nginx >= 1.3.7
  180. ssl_stapling_verify on; # Requires nginx => 1.3.7
  181. add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
  182. add_header X-Frame-Options DENY;
  183. add_header X-Content-Type-Options nosniff;
  184.  
  185. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement