Skip to content

Commit 304e756

Browse files
committed
Attempt 1
1 parent 3d1e9f6 commit 304e756

File tree

1 file changed

+41
-23
lines changed

1 file changed

+41
-23
lines changed
Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,43 @@
11
server {
2-
listen 80 default_server;
3-
location /hbnb_static { alias /data/web_static/current/;}
4-
listen [::]:80 default_server;
5-
root /var/www/html;
6-
index index.html index.htm index.nginx-debian.html
7-
server_name_;
8-
add_header X-Served-By $hostname;
9-
location / {
10-
try_files $uri $uri/ =404;
11-
}
12-
location /airbnb-onepage {
13-
proxy_pass http://0.0.0.0:5000/airbnb-onepage;
14-
}
15-
location ~ ^/airbnb-dynamic/number_odd_or_even/([0-9]+)$ {
16-
proxy_pass http://0.0.0.0:5001/number_odd_or_even/$1;
17-
}
18-
if ($request_filename ~ redirect_me){
19-
rewrite ^ https://th3-gr00t.tk/ permanent;
20-
}
21-
error_page 404 /error_404.html;
22-
location = /error_404.html {
23-
internal;
24-
}
2+
listen 80 default_server;
3+
listen [::]:80 default_server;
4+
server_name _;
5+
6+
root /var/www/html;
7+
index index.html index.htm index.nginx-debian.html;
8+
9+
add_header X-Served-By $hostname;
10+
11+
location / {
12+
try_files $uri $uri/ =404;
13+
}
14+
15+
location /hbnb_static {
16+
alias /data/web_static/current/;
17+
}
18+
19+
location /airbnb-onepage {
20+
proxy_pass http://127.0.0.1:5000;
21+
proxy_set_header Host $host;
22+
proxy_set_header X-Real-IP $remote_addr;
23+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
24+
proxy_set_header X-Forwarded-Proto $scheme;
25+
}
26+
27+
location ~ ^/airbnb-dynamic/number_odd_or_even/([0-9]+)$ {
28+
proxy_pass http://127.0.0.1:5001/number_odd_or_even/$1;
29+
proxy_set_header Host $host;
30+
proxy_set_header X-Real-IP $remote_addr;
31+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
32+
proxy_set_header X-Forwarded-Proto $scheme;
33+
}
34+
35+
location /redirect_me {
36+
return 301 https://th3-gr00t.tk/;
37+
}
38+
39+
error_page 404 /error_404.html;
40+
location = /error_404.html {
41+
internal;
42+
}
2543
}

0 commit comments

Comments
 (0)