mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Добавлен внутренний редирект для кейса, когда запрос будет идти на старый домен
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user