Skip to content

Commit 51dc139

Browse files
committed
fix
1 parent 7eb3c7c commit 51dc139

File tree

1 file changed

+14
-28
lines changed

1 file changed

+14
-28
lines changed

nginx.conf

+14-28
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,29 @@ http {
1212

1313
sendfile on;
1414
keepalive_timeout 65;
15+
gzip on;
16+
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
17+
gzip_min_length 256;
1518

16-
# Server block for the domain
1719
server {
1820
listen 80;
1921
server_name heartlink.slghive.fr;
20-
22+
2123
location / {
22-
proxy_pass http://116.202.238.184;
23-
proxy_set_header Host $host;
24-
proxy_set_header X-Real-IP $remote_addr;
25-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
26-
proxy_set_header X-Forwarded-Proto $scheme;
27-
}
28-
29-
error_page 500 502 503 504 /50x.html;
30-
location = /50x.html {
3124
root /usr/share/nginx/html;
25+
index index.html index.htm;
26+
try_files $uri $uri/ /index.html;
3227
}
33-
}
3428

35-
# Server block for the IP address to redirect to the domain
36-
server {
37-
listen 80;
38-
server_name 116.202.238.184;
39-
40-
return 301 http://heartlink.slghive.fr$request_uri;
41-
}
42-
43-
# Default server block (optional, can be removed if not needed)
44-
server {
45-
listen 80;
46-
server_name localhost;
29+
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
30+
expires -1;
31+
# access_log logs/static.log; # Uncomment if you want to log static file access
32+
}
4733

48-
location / {
49-
root /usr/share/nginx/html;
50-
index index.html;
51-
try_files $uri $uri/ /index.html;
34+
location ~* \.(?:css|js|woff2?|ttf|otf|eot|ico|svg|gif|jpe?g|png)$ {
35+
expires 1y;
36+
access_log off;
37+
add_header Cache-Control "public";
5238
}
5339

5440
error_page 500 502 503 504 /50x.html;

0 commit comments

Comments
 (0)