Guest User

Untitled

a guest
Jan 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1. 'urlManager' => [
  2. 'enablePrettyUrl' => true,
  3. 'showScriptName' => false,
  4. 'rules' => [
  5. ],
  6. ],
  7.  
  8. server {
  9. listen 8080;
  10. server_name xxxxxxxx;
  11.  
  12. set $base_root /var/www/xxxxxxx/html;
  13. root $base_root;
  14.  
  15. #error_log /var/log/nginx/advanced.local.error.log warn;
  16. #access_log /var/log/nginx/advanced.local.access.log main;
  17. charset UTF-8;
  18. index index.php index.html;
  19.  
  20. location / {
  21. root $base_root/frontend/web;
  22. try_files $uri $uri/ /frontend/web/index.php$is_args$args;
  23.  
  24. # omit static files logging, and if they don't exist, avoid processing by Yii (uncomment if necessary)
  25. #location ~ ^/.+.(css|js|ico|png|jpe?g|gif|svg|ttf|mp4|mov|swf|pdf|zip|rar)$ {
  26. # log_not_found off;
  27. # access_log off;
  28. # try_files $uri =404;
  29. #}
  30.  
  31. location ~ ^/assets/.+.php(/|$) {
  32. deny all;
  33. }
  34.  
  35. include /etc/nginx/mime.types;
  36.  
  37. types {font/truetype ttf;}
  38. types {application/font-woff woff;}
  39. types {application/font-woff2 woff2;}
  40. }
  41.  
  42. location ~ .css {
  43. add_header Content-Type text/css;
  44. }
  45. location ~ .js {
  46. add_header Content-Type application/x-javascript;
  47. }
  48.  
  49. location /backend/web/assets/{
  50. alias /var/www/xxxxxxx/html/backend/web/assets/;
  51.  
  52. include /etc/nginx/mime.types;
  53.  
  54. types {font/truetype ttf;}
  55. types {application/font-woff woff;}
  56. types {application/font-woff2 woff2;}
  57. }
  58.  
  59. location /frontend/web/assets/{
  60. alias /var/www/xxxxxxxxx/html/frontend/web/assets/;
  61.  
  62. include /etc/nginx/mime.types;
  63.  
  64. types {font/truetype ttf;}
  65. types {application/font-woff woff;}
  66. types {application/font-woff2 woff2;}
  67. }
  68.  
  69. location /admin {
  70. alias $base_root/backend/web/;
  71.  
  72. # redirect to the URL without a trailing slash (uncomment if necessary)
  73. #location = /admin/ {
  74. # return 301 /admin;
  75. #}
  76.  
  77. # prevent the directory redirect to the URL with a trailing slash
  78. location = /admin {
  79. # if your location is "/backend", try use "/backend/backend/web/index.php$is_args$args"
  80. # bug ticket: https://trac.nginx.org/nginx/ticket/97
  81. try_files $uri /backend/web/index.php$is_args$args;
  82. }
  83.  
  84. # if your location is "/backend", try use "/backend/backend/web/index.php$is_args$args"
  85. # bug ticket: https://trac.nginx.org/nginx/ticket/97
  86. try_files $uri $uri/ /backend/web/index.php$is_args$args;
  87.  
  88. # omit static files logging, and if they don't exist, avoid processing by Yii (uncomment if necessary)
  89. #location ~ ^/admin/.+.(css|js|ico|png|jpe?g|gif|svg|ttf|mp4|mov|swf|pdf|zip|rar)$ {
  90. # log_not_found off;
  91. # access_log off;
  92. # try_files $uri =404;
  93. #}
  94.  
  95.  
  96. location ~ .css {
  97. add_header Content-Type text/css;
  98. }
  99. location ~ .js {
  100. add_header Content-Type application/x-javascript;
  101. }
  102.  
  103.  
  104. include /etc/nginx/mime.types;
  105.  
  106. types {font/truetype ttf;}
  107. types {application/font-woff woff;}
  108. types {application/font-woff2 woff2;}
  109.  
  110. location ~ ^/admin/assets/.+.php(/|$) {
  111. deny all;
  112. }
  113. }
  114.  
  115. location ~ ^/.+.php(/|$) {
  116. rewrite (?!^/((frontend|backend)/web|admin))^ /frontend/web$uri break;
  117. rewrite (?!^/backend/web)^/admin(/.+)$ /backend/web$1 break;
  118.  
  119. fastcgi_pass 127.0.0.1:9000; # proxy requests to a TCP socket
  120. #fastcgi_pass unix:/var/run/php-fpm.sock; # proxy requests to a UNIX domain socket (check your www.conf file)
  121. fastcgi_split_path_info ^(.+.php)(.*)$;
  122. include /etc/nginx/fastcgi_params;
  123. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  124. try_files $fastcgi_script_name =404;
  125. }
  126.  
  127. location ~ /. {
  128. deny all;
  129. }
  130. }
Add Comment
Please, Sign In to add comment