Advertisement
alpa_s

Untitled

Jun 22nd, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.72 KB | None | 0 0
  1. nsk-pro@fazze-dev:/opt/fazze/fazze_root$ cat /etc/nginx/conf.d/fazze-dev.adnow-web.ru.conf
  2. server {
  3. listen 80;
  4. server_name fazze-dev.adnow-web.ru;
  5. access_log off;
  6. access_log /var/log/nginx/fazze-dev.adnow-web.ru.access.log;
  7. error_log /var/log/nginx/fazze-dev.adnow-web.ru.log debug;
  8. add_header 'Access-Control-Allow-Origin' '*';
  9. gzip on;
  10. gzip_comp_level 5;
  11. gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
  12. location ~ \.(ico|css|js|jpg|mp4|png|woff2|mov|pdf|woff|ttf) {
  13. rewrite ^(.*) https://fazzecom.gcdn.co$request_uri;
  14. access_log off;
  15. }
  16. location / {
  17. proxy_set_header Host fazze-dev.adnow-web.ru;
  18. proxy_set_header X-Forwarded-For $remote_addr;
  19. proxy_read_timeout 5s;
  20. proxy_pass http://192.168.11.44:50882;
  21. }
  22.  
  23. }
  24. nsk-pro@fazze-dev:/opt/fazze/fazze_root$ cat docker/nginx/vhost.conf
  25. server {
  26. listen 80;
  27. server_name fazze-dev.adnow-web.ru;
  28.  
  29. set $base_root /app;
  30. root $base_root;
  31.  
  32. # error_log /var/log/nginx/advanced.local.error.log warn;
  33. # access_log /var/log/nginx/advanced.local.access.log main;
  34. charset UTF-8;
  35. index index.php index.html;
  36.  
  37. location / {
  38. root $base_root/frontend/web;
  39. try_files $uri $uri/ /frontend/web/index.php$is_args$args;
  40.  
  41. # omit static files logging, and if they don't exist, avoid processing by Yii (uncomment if necessary)
  42. #location ~ ^/.+\.(css|js|ico|png|jpe?g|gif|svg|ttf|mp4|mov|swf|pdf|zip|rar)$ {
  43. # log_not_found off;
  44. # access_log off;
  45. # try_files $uri =404;
  46. #}
  47.  
  48. location ~ ^/assets/.+\.php(/|$) {
  49. deny all;
  50. }
  51. }
  52.  
  53. location /admin {
  54. alias $base_root/backend/web/;
  55.  
  56. # redirect to the URL without a trailing slash (uncomment if necessary)
  57. #location = /admin/ {
  58. # return 301 /admin;
  59. #}
  60.  
  61. # prevent the directory redirect to the URL with a trailing slash
  62. location = /admin {
  63. # if your location is "/backend", try use "/backend/backend/web/index.php$is_args$args"
  64. # bug ticket: https://trac.nginx.org/nginx/ticket/97
  65. try_files $uri /backend/web/index.php$is_args$args;
  66. }
  67.  
  68. # if your location is "/backend", try use "/backend/backend/web/index.php$is_args$args"
  69. # bug ticket: https://trac.nginx.org/nginx/ticket/97
  70. try_files $uri $uri/ /backend/web/index.php$is_args$args;
  71.  
  72. # omit static files logging, and if they don't exist, avoid processing by Yii (uncomment if necessary)
  73. #location ~ ^/admin/.+\.(css|js|ico|png|jpe?g|gif|svg|ttf|mp4|mov|swf|pdf|zip|rar)$ {
  74. # log_not_found off;
  75. # access_log off;
  76. # try_files $uri =404;
  77. #}
  78.  
  79. location ~ ^/admin/assets/.+\.php(/|$) {
  80. deny all;
  81. }
  82. }
  83.  
  84. location ~ ^/.+\.php(/|$) {
  85. rewrite (?!^/((frontend|backend)/web|admin))^ /frontend/web$uri break;
  86. rewrite (?!^/backend/web)^/admin(/.+)$ /backend/web$1 break;
  87.  
  88. fastcgi_pass php-fpm; # proxy requests to a TCP socket
  89. #fastcgi_pass unix:/var/run/php-fpm.sock; # proxy requests to a UNIX domain socket (check your www.conf file)
  90. fastcgi_split_path_info ^(.+\.php)(.*)$;
  91. include /etc/nginx/fastcgi_params;
  92. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  93. try_files $fastcgi_script_name =404;
  94. }
  95.  
  96. location ~ /\. {
  97. deny all;
  98. }
  99. }
  100.  
  101. ## PHP-FPM Servers ##
  102. upstream php-fpm {
  103. server app:9000;
  104. }
  105. nsk-pro@fazze-dev:/opt/fazze/fazze_root$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement