nginx
This commit is contained in:
41
nginx.conf
41
nginx.conf
@@ -50,10 +50,47 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
server_name lovero.store www.lovero.store;
|
server_name lovero.store www.lovero.store;
|
||||||
|
|
||||||
|
root /var/www/loveromarket/browser;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
# Angular routing
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://127.0.0.1:4202;
|
try_files $uri $uri/ /index.html =404;
|
||||||
proxy_set_header Host $host;
|
}
|
||||||
|
|
||||||
|
# Proxy API calls to backend
|
||||||
|
location /api {
|
||||||
|
proxy_pass https://api.lovero.store:555;
|
||||||
|
proxy_set_header Host api.lovero.store;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
rewrite ^/api(/.*)$ $1 break;
|
||||||
|
proxy_ssl_verify off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Static assets caching
|
||||||
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||||
|
expires 1y;
|
||||||
|
add_header Cache-Control "public, immutable";
|
||||||
|
try_files $uri =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Don't cache index.html
|
||||||
|
location = /index.html {
|
||||||
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||||
|
add_header Pragma "no-cache";
|
||||||
|
add_header Expires "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_proxied any;
|
||||||
|
gzip_comp_level 6;
|
||||||
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
||||||
|
gzip_min_length 1000;
|
||||||
|
|
||||||
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user