Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. ##
  2. # You should look at the following URL's in order to grasp a solid understanding
  3. # of Nginx configuration files in order to fully unleash the power of Nginx.
  4. # http://wiki.nginx.org/Pitfalls
  5. # http://wiki.nginx.org/QuickStart
  6. # http://wiki.nginx.org/Configuration
  7. #
  8. # Generally, you will want to move this file somewhere, and start with a clean
  9. # file but keep this around for reference. Or just disable in sites-enabled.
  10. #
  11. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  12. ##
  13.  
  14. # Default server configuration
  15. #
  16. server {
  17.  
  18. listen 80 default_server;
  19. listen [::]:80 default_server;
  20.  
  21. root /var/www/soft-collection-frontend/dist;
  22.  
  23. index index.php app.php index.html;
  24.  
  25. server_name soft-collection-qa.tendertech.ru;
  26.  
  27.  
  28. location /scapi {
  29. root $symfonyRoot;
  30. rewrite ^/scapi/(.*)$ /$1 break;
  31. try_files $uri @symfonyFront;
  32.  
  33. location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
  34. # Some basic cache-control for static files to be sent to the browser
  35. expires max;
  36. add_header Pragma public;
  37. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  38. }
  39. }
  40.  
  41. location / {
  42. try_files $uri $uri/ @rewrites;
  43. }
  44.  
  45. set $symfonyRoot /var/www/soft-collection-backend/public;
  46. set $symfonyScript index.php;
  47.  
  48.  
  49. location @symfonyFront {
  50. fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  51. include /etc/nginx/fastcgi_params;
  52. fastcgi_param SCRIPT_FILENAME $symfonyRoot/$symfonyScript;
  53. fastcgi_param SCRIPT_NAME /scapi/$symfonyScript;
  54. fastcgi_param REQUEST_URI /scapi$uri?$args;
  55.  
  56. }
  57.  
  58.  
  59. location @rewrites {
  60. rewrite ^(.+)$ /index.html last;
  61. }
  62.  
  63. }
  64.  
  65.  
  66. # Virtual Host configuration for example.com
  67. #
  68. # You can move that to a different file under sites-available/ and symlink that
  69. # to sites-enabled/ to enable it.
  70. #
  71. #server {
  72. # listen 80;
  73. # listen [::]:80;
  74. #
  75. # server_name example.com;
  76. #
  77. # root /var/www/example.com;
  78. # index index.html;
  79. #
  80. # location / {
  81. # try_files $uri $uri/ =404;
  82. # }
  83. #}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement