Добавлен внутренний редирект для кейса, когда запрос будет идти на старый домен

This commit is contained in:
ErickSkrauch
2016-08-23 00:32:12 +03:00
parent 72a7f743be
commit 27a9f9d3f8
5 changed files with 68 additions and 43 deletions

View File

@@ -21,47 +21,5 @@ http {
sendfile on;
keepalive_timeout 10;
server {
listen 80;
set $root_path '/var/www/html';
set $api_path '${root_path}/api/web';
set $frontend_path '${root_path}/frontend/dist';
root $root_path;
charset utf-8;
client_max_body_size 2M;
etag on;
location / {
alias $frontend_path;
index index.html;
try_files $uri /index.html =404;
}
location /api {
try_files $uri /api/web/index.php?$args;
}
location ~* \.php$ {
fastcgi_pass app:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_NAME $host;
}
# html файлы идут отдельно, для них будет применяться E-Tag кэширование
location ~* \.html$ {
root $frontend_path;
access_log off;
}
# Раздача статики для frontend с указанием max-кэша. Сброс будет по #hash после ребилда webpackом
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|json|css|zip|rar|eot|ttf|woff|ico) {
root $frontend_path;
expires max;
access_log off;
}
}
include /etc/nginx/conf.d/*.conf;
}