Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alpas@alpas-pc:~$ cat /etc/nginx/sites-available/fazze_docker
- server {
- listen 80;
- server_name fazze-dev.adnow-web.ru;
- access_log off;
- access_log /var/log/nginx/fazze-dev.adnow-web.ru.access.log;
- error_log /var/log/nginx/fazze-dev.adnow-web.ru.log debug;
- add_header 'Access-Control-Allow-Origin' '*';
- gzip on;
- gzip_comp_level 5;
- gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
- location ~ \.(ico|css|js|jpg|mp4|png|woff2|mov|pdf|woff|ttf) {
- rewrite ^(.*) https://fazzecom.gcdn.co$request_uri;
- access_log off;
- }
- location / {
- proxy_set_header Host fazze-dev.adnow-web.ru;
- proxy_set_header X-Forwarded-For $remote_addr;
- proxy_read_timeout 5s;
- proxy_pass http://127.0.0.1:82;
- }
- }
- alpas@alpas-pc:~$ cat Projects/PHP/fazze.loc/docker/nginx/vhost.conf
- server {
- listen 80;
- server_name fazze-dev.adnow-web.ru;
- set $base_root /app;
- root $base_root;
- #error_log /var/log/nginx/advanced.local.error.log warn;
- #access_log /var/log/nginx/advanced.local.access.log main;
- charset UTF-8;
- index index.php index.html;
- location / {
- root $base_root/frontend/web;
- try_files $uri $uri/ /frontend/web/index.php$is_args$args;
- # omit static files logging, and if they don't exist, avoid processing by Yii (uncomment if necessary)
- #location ~ ^/.+\.(css|js|ico|png|jpe?g|gif|svg|ttf|mp4|mov|swf|pdf|zip|rar)$ {
- # log_not_found off;
- # access_log off;
- # try_files $uri =404;
- #}
- location ~ ^/assets/.+\.php(/|$) {
- deny all;
- }
- }
- location /admin {
- alias $base_root/backend/web/;
- # redirect to the URL without a trailing slash (uncomment if necessary)
- #location = /admin/ {
- # return 301 /admin;
- #}
- # prevent the directory redirect to the URL with a trailing slash
- location = /admin {
- # if your location is "/backend", try use "/backend/backend/web/index.php$is_args$args"
- # bug ticket: https://trac.nginx.org/nginx/ticket/97
- try_files $uri /backend/web/index.php$is_args$args;
- }
- # if your location is "/backend", try use "/backend/backend/web/index.php$is_args$args"
- # bug ticket: https://trac.nginx.org/nginx/ticket/97
- try_files $uri $uri/ /backend/web/index.php$is_args$args;
- # omit static files logging, and if they don't exist, avoid processing by Yii (uncomment if necessary)
- #location ~ ^/admin/.+\.(css|js|ico|png|jpe?g|gif|svg|ttf|mp4|mov|swf|pdf|zip|rar)$ {
- # log_not_found off;
- # access_log off;
- # try_files $uri =404;
- #}
- location ~ ^/admin/assets/.+\.php(/|$) {
- deny all;
- }
- }
- location ~ ^/.+\.php(/|$) {
- rewrite (?!^/((frontend|backend)/web|admin))^ /frontend/web$uri break;
- rewrite (?!^/backend/web)^/admin(/.+)$ /backend/web$1 break;
- fastcgi_pass php-fpm; # proxy requests to a TCP socket
- #fastcgi_pass unix:/var/run/php-fpm.sock; # proxy requests to a UNIX domain socket (check your www.conf file)
- fastcgi_split_path_info ^(.+\.php)(.*)$;
- include /etc/nginx/fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- try_files $fastcgi_script_name =404;
- }
- location ~ /\. {
- deny all;
- }
- }
- ## PHP-FPM Servers ##
- upstream php-fpm {
- server app:9000;
- }alpas@alpas-pc:~$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement