Skip to content

Commit 7eb3c7c

Browse files
committed
fix nginx
1 parent 85bff2a commit 7eb3c7c

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

nginx.conf

+32-5
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,44 @@ http {
1313
sendfile on;
1414
keepalive_timeout 65;
1515

16+
# Server block for the domain
1617
server {
1718
listen 80;
18-
server_name localhost;
19+
server_name heartlink.slghive.fr;
1920

21+
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+
}
2028

21-
location / {
22-
root /usr/share/nginx/html;
23-
index index.html;
24-
try_files $uri $uri/ /index.html;
29+
error_page 500 502 503 504 /50x.html;
30+
location = /50x.html {
31+
root /usr/share/nginx/html;
32+
}
2533
}
2634

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;
47+
48+
location / {
49+
root /usr/share/nginx/html;
50+
index index.html;
51+
try_files $uri $uri/ /index.html;
52+
}
53+
2754
error_page 500 502 503 504 /50x.html;
2855
location = /50x.html {
2956
root /usr/share/nginx/html;

0 commit comments

Comments
 (0)