Report this

What is the reason for this report?

NGINX rewrite port 8080

Posted on July 30, 2013

I’m trying to run an instance of news.arc (that’s the HackerNews board), but I can’t quite decode if I’m supposed to use a rewrite rule, a redirect, a proxy_pass, an upstream, or some sort of magical mystical incantation.

I’m pretty sure that SETT is being reverse proxied through Nginx the same way, and I’d appreciate any help offered.

Here’s where it’s currently running: http://blaireaug.com:8080/

But I’d like it to be at news.blaireaug.com

Here’s the text from my sites-available/www file. What’s the right config?

upstream news {
server news.blaireaug.com weight=5;
server blaireaug.com:8080 max_fails=3 fail_timeout=30s;
}

server {
listen http://127.0.0.1:8080;
server_name news.blaireaug.com;

location / {
proxy_pass http://127.0.0.1:8080;}
}

location /news/ {
rewrite /news/ (.*) /$1 break;
rewrite ^/news$ /news/ permanent;
proxy_pass http://localhost:8080/;
proxy_redirect / /news/;
} 

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.