Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. server {
  2. listen 192.192.192.192:80;
  3. server_name www.mysite.net;
  4. root /home/www/mysite.net/static.www/;
  5. error_log /var/log/nginx/mysite.net-error.log warn;
  6. access_log /var/log/nginx/mysite.net-access.log detailed;
  7.  
  8. location / {
  9. error_page 404 = @php;
  10.  
  11. location ~ \. {
  12. expires 24h;
  13. }
  14. return 404;
  15. }
  16.  
  17. location @php {
  18. include /etc/nginx/fastcgi_params;
  19. fastcgi_param SCRIPT_FILENAME /home/www/mysite.net/engine/index.php;
  20. fastcgi_param HTTPS $http_x_forwarded_https if_not_empty;
  21. fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
  22. }
  23. }
  24.  
  25. server {
  26. listen 192.192.192.192:80;
  27. server_name mysite.net;
  28. root /home/www/mysite.net/static/;
  29. error_log /var/log/nginx/mysite.net-error.log warn;
  30. access_log /var/log/nginx/mysite.net-access.log detailed;
  31.  
  32. location = / {
  33. return 301 https://www.mysite.net/;
  34. }
  35.  
  36. location /
  37. {
  38. add_header Cache-control public;
  39. add_header Access-Control-Allow-Origin https://www.mysite.net;
  40. expires 24h;
  41. error_page 404 = @php;
  42. log_not_found off; }
  43.  
  44. location @php {
  45. include /etc/nginx/fastcgi_params;
  46. fastcgi_param SCRIPT_FILENAME /home/www/mysite.net/engine/static.php;
  47. fastcgi_param HTTPS $http_x_forwarded_https if_not_empty;
  48. fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement