Advertisement
Guest User

Untitled

a guest
May 14th, 2019
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name www.test.example.com;
  4. return 301 $scheme://test.example.com$request_uri;
  5. }
  6.  
  7. server {
  8. listen 80;
  9. server_name test.example.com;
  10. root /opt/cura/current/public;
  11.  
  12. index index.html index.htm index.php;
  13.  
  14. charset utf-8;
  15.  
  16. location / {
  17.  
  18. ####### HANDLE PREFLIGHTED REQUESTS #############
  19. if ($request_method = OPTIONS ) {
  20. add_header "Access-Control-Allow-Origin" "http://test.example.com";
  21. add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD";
  22. add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept, x-csrf-token";
  23. return 200;
  24. }
  25.  
  26. try_files $uri $uri/ /index.php?$query_string;
  27. }
  28.  
  29. location = /favicon.ico { access_log off; log_not_found off; }
  30. location = /robots.txt { access_log off; log_not_found off; }
  31.  
  32. # access_log off;
  33. access_log /var/log/nginx/cura-access.log main;
  34. error_log /var/log/nginx/cura-error.log error;
  35.  
  36. error_page 404 /index.php;
  37.  
  38. location ~ \.php$ {
  39. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  40. fastcgi_pass 127.0.0.1:9000;
  41. include snippets/fastcgi-php.conf;
  42. include fastcgi_params;
  43. #include snippets/cura.com-cors;
  44. }
  45.  
  46. location ~ /\.ht {
  47. deny all;
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement