I'm trying to set up a simple static website, and I have an issue with nginx that's complicated by a number of things, most notably the fact that my ISP blocks all inbound port 80 traffic.
First, I got a web forward set up so that www.mysite.com will redirect to mysite.com:8000, and then I set up my router to forward port 8000 to my server running nginx. This gets around my ISP's block on port 80. I'm now attempting to have nginx on the server proxy the request on port 8000 to a virtual host on port 80, so that the site will show up as mysite.com after it loads rather than mysite.com:8000.
I've been trying to do this with nginx's proxy_pass
directive, but no matter what I do the site always shows up as mysite.com:8000.
Here's what I have so far:
server {
listen [::]:8000
server_name mysite.com;
location / {
proxy_pass http://127.0.0.1:80;
proxy_redirect default;
proxy_set_header Host $http_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 http;
}
}
server {
listen 127.0.0.1:80;
server_name mysite.com;
root /var/www/homepage;
index index.html;
.
. (non-relevant stuff)
.
}
Link to the actual site: http://www.bjacobel.com
I've also tried to do this by forwarding port 8000 at the router to port 80, and having nginx listen on port 80, but the url with :8000 in it still shows up.
Thanks for your help!