Advertisement
alpa_s

Untitled

Jun 22nd, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. alpas@alpas-pc:~$ cat /etc/nginx/sites-available/fazze_docker
  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://127.0.0.1:82;
  21. }
  22.  
  23. }
  24.  
  25.  
  26. alpas@alpas-pc:~$ cat Projects/PHP/fazze.loc/docker/nginx/vhost.conf
  27. server {
  28. listen 80;
  29. server_name fazze-dev.adnow-web.ru;
  30.  
  31. set $base_root /app;
  32. root $base_root;
  33.  
  34. #error_log /var/log/nginx/advanced.local.error.log warn;
  35. #access_log /var/log/nginx/advanced.local.access.log main;
  36. charset UTF-8;
  37. index index.php index.html;
  38.  
  39. location / {
  40. root $base_root/frontend/web;
  41. try_files $uri $uri/ /frontend/web/index.php$is_args$args;
  42.  
  43. # omit static files logging, and if they don't exist, avoid processing by Yii (uncomment if necessary)
  44. #location ~ ^/.+\.(css|js|ico|png|jpe?g|gif|svg|ttf|mp4|mov|swf|pdf|zip|rar)$ {
  45. # log_not_found off;
  46. # access_log off;
  47. # try_files $uri =404;
  48. #}
  49.  
  50. location ~ ^/assets/.+\.php(/|$) {
  51. deny all;
  52. }
  53. }
  54.  
  55. location /admin {
  56. alias $base_root/backend/web/;
  57.  
  58. # redirect to the URL without a trailing slash (uncomment if necessary)
  59. #location = /admin/ {
  60. # return 301 /admin;
  61. #}
  62.  
  63. # prevent the directory redirect to the URL with a trailing slash
  64. location = /admin {
  65. # if your location is "/backend", try use "/backend/backend/web/index.php$is_args$args"
  66. # bug ticket: https://trac.nginx.org/nginx/ticket/97
  67. try_files $uri /backend/web/index.php$is_args$args;
  68. }
  69.  
  70. # if your location is "/backend", try use "/backend/backend/web/index.php$is_args$args"
  71. # bug ticket: https://trac.nginx.org/nginx/ticket/97
  72. try_files $uri $uri/ /backend/web/index.php$is_args$args;
  73.  
  74. # omit static files logging, and if they don't exist, avoid processing by Yii (uncomment if necessary)
  75. #location ~ ^/admin/.+\.(css|js|ico|png|jpe?g|gif|svg|ttf|mp4|mov|swf|pdf|zip|rar)$ {
  76. # log_not_found off;
  77. # access_log off;
  78. # try_files $uri =404;
  79. #}
  80.  
  81. location ~ ^/admin/assets/.+\.php(/|$) {
  82. deny all;
  83. }
  84. }
  85.  
  86. location ~ ^/.+\.php(/|$) {
  87. rewrite (?!^/((frontend|backend)/web|admin))^ /frontend/web$uri break;
  88. rewrite (?!^/backend/web)^/admin(/.+)$ /backend/web$1 break;
  89.  
  90. fastcgi_pass php-fpm; # proxy requests to a TCP socket
  91. #fastcgi_pass unix:/var/run/php-fpm.sock; # proxy requests to a UNIX domain socket (check your www.conf file)
  92. fastcgi_split_path_info ^(.+\.php)(.*)$;
  93. include /etc/nginx/fastcgi_params;
  94. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  95. try_files $fastcgi_script_name =404;
  96. }
  97.  
  98. location ~ /\. {
  99. deny all;
  100. }
  101. }
  102.  
  103. ## PHP-FPM Servers ##
  104. upstream php-fpm {
  105. server app:9000;
  106. }alpas@alpas-pc:~$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement