-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d1e9f6
commit 304e756
Showing
1 changed file
with
41 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,43 @@ | ||
server { | ||
listen 80 default_server; | ||
location /hbnb_static { alias /data/web_static/current/;} | ||
listen [::]:80 default_server; | ||
root /var/www/html; | ||
index index.html index.htm index.nginx-debian.html | ||
server_name_; | ||
add_header X-Served-By $hostname; | ||
location / { | ||
try_files $uri $uri/ =404; | ||
} | ||
location /airbnb-onepage { | ||
proxy_pass http://0.0.0.0:5000/airbnb-onepage; | ||
} | ||
location ~ ^/airbnb-dynamic/number_odd_or_even/([0-9]+)$ { | ||
proxy_pass http://0.0.0.0:5001/number_odd_or_even/$1; | ||
} | ||
if ($request_filename ~ redirect_me){ | ||
rewrite ^ https://th3-gr00t.tk/ permanent; | ||
} | ||
error_page 404 /error_404.html; | ||
location = /error_404.html { | ||
internal; | ||
} | ||
listen 80 default_server; | ||
listen [::]:80 default_server; | ||
server_name _; | ||
|
||
root /var/www/html; | ||
index index.html index.htm index.nginx-debian.html; | ||
|
||
add_header X-Served-By $hostname; | ||
|
||
location / { | ||
try_files $uri $uri/ =404; | ||
} | ||
|
||
location /hbnb_static { | ||
alias /data/web_static/current/; | ||
} | ||
|
||
location /airbnb-onepage { | ||
proxy_pass http://127.0.0.1:5000; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location ~ ^/airbnb-dynamic/number_odd_or_even/([0-9]+)$ { | ||
proxy_pass http://127.0.0.1:5001/number_odd_or_even/$1; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location /redirect_me { | ||
return 301 https://th3-gr00t.tk/; | ||
} | ||
|
||
error_page 404 /error_404.html; | ||
location = /error_404.html { | ||
internal; | ||
} | ||
} |