Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 KB | None | 0 0
  1. # FORGE CONFIG (DOT NOT REMOVE!)
  2. include forge-conf/example.com/before/*;
  3.  
  4. server {
  5. listen 80;
  6. server_name www.example.com;
  7. return 301 https://www.example.com;
  8. }
  9.  
  10.  
  11. server {
  12. listen 443 ssl;
  13. server_name example.com;
  14.  
  15.  
  16. #redirect non www to www.
  17. return 301 https://www.example.com;
  18.  
  19. # root /home/forge/example.com/public;
  20.  
  21. # FORGE SSL (DO NOT REMOVE!)
  22. ssl_certificate /etc/nginx/ssl/example.com/140111/server.crt;
  23. ssl_certificate_key /etc/nginx/ssl/example.com/140111/server.key;
  24.  
  25. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  26.  
  27. index index.html index.htm index.php;
  28.  
  29. charset utf-8;
  30.  
  31. # FORGE CONFIG (DOT NOT REMOVE!)
  32. include forge-conf/example.com/server/*;
  33.  
  34. location / {
  35. try_files $uri $uri/ /index.php?$query_string;
  36. }
  37.  
  38. location = /favicon.ico { access_log off; log_not_found off; }
  39. location = /robots.txt { access_log off; log_not_found off; }
  40.  
  41. access_log off;
  42. error_log /var/log/nginx/example.com-error.log error;
  43.  
  44. error_page 404 /index.php;
  45.  
  46. location ~ .php$ {
  47. fastcgi_split_path_info ^(.+.php)(/.+)$;
  48. fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  49. fastcgi_index index.php;
  50. include fastcgi_params;
  51. }
  52.  
  53. location ~ /.ht {
  54. deny all;
  55. }
  56.  
  57. #cache:
  58. location ~* .(css|js|gif|jpe?g|png)$ {
  59. expires 168h;
  60. add_header Pragma public;
  61. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  62. }
  63.  
  64.  
  65. }
  66.  
  67. server {
  68. listen 443 ssl;
  69. server_name www.example.com;
  70.  
  71. root /home/forge/example.com/public;
  72.  
  73. # FORGE SSL (DO NOT REMOVE!)
  74. ssl_certificate /etc/nginx/ssl/example.com/140111/server.crt;
  75. ssl_certificate_key /etc/nginx/ssl/example.com/140111/server.key;
  76.  
  77. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  78.  
  79. index index.html index.htm index.php;
  80.  
  81. charset utf-8;
  82.  
  83. # FORGE CONFIG (DOT NOT REMOVE!)
  84. include forge-conf/example.com/server/*;
  85.  
  86. location / {
  87. try_files $uri $uri/ /index.php?$query_string;
  88. }
  89.  
  90. location = /favicon.ico { access_log off; log_not_found off; }
  91. location = /robots.txt { access_log off; log_not_found off; }
  92.  
  93. access_log off;
  94. error_log /var/log/nginx/example.com-error.log error;
  95.  
  96. error_page 404 /index.php;
  97.  
  98. location ~ .php$ {
  99. fastcgi_split_path_info ^(.+.php)(/.+)$;
  100. fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  101. fastcgi_index index.php;
  102. include fastcgi_params;
  103. }
  104.  
  105. location ~ /.ht {
  106. deny all;
  107. }
  108.  
  109. #cache:
  110. location ~* .(css|js|gif|jpe?g|png)$ {
  111. expires 168h;
  112. add_header Pragma public;
  113. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  114. }
  115.  
  116. }
  117.  
  118.  
  119. # FORGE CONFIG (DOT NOT REMOVE!)
  120. include forge-conf/example.com/after/*;
  121.  
  122. server {
  123. listen 80;
  124. listen 443 default_server ssl;
  125.  
  126. server_name www.example.com;
  127.  
  128. ssl_certificate /path/to/my/cert;
  129. ssl_certificate_key /path/to/my/key;
  130.  
  131. if ($scheme = http) {
  132. return 301 https://$server_name$request_uri;
  133. }
  134. }
  135.  
  136. server {
  137. listen 80;
  138. server_name www.example.com example.com;
  139.  
  140. # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
  141. return 302 https://www.example.com$request_uri;
  142. }
  143.  
  144. server {
  145. listen 443;
  146. server_name example.com;
  147. include /etc/nginx/conf-available/ssl.conf;
  148.  
  149. # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
  150. return 302 https://www.example.com$request_uri;
  151. }
  152.  
  153.  
  154. server {
  155. listen 443 ssl http2 default_server;
  156. # listen [::]:443 ssl http2 default_server;
  157.  
  158. server_name www.example.com;
  159.  
  160. include /etc/nginx/conf-available/ssl.conf;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement