0

I am trying to put a development server in place on the same server as the production server. The two will run on different ports, and one will be accessible via prod.example.com and the other via dev.example.com. There is a DNS A record in place already.

I would like the following :

 www.example.com => port 9393 www1.example.com => port 9393 anysubdomain.example.com => port 9393 dev.example.com => port 19393 

Here is what I have so far (not working) :

http { server { listen 80; server_name localhost; root /var/www/...; Location / { proxy_pass http://127.0.0.1:9393/; } server { listen 80; server_name dev.*; location / { proxy_pass http://localhost:19393; } } } 

I've seen the following Q/A :

1
  • Could a default help ? Commented Jul 31, 2015 at 10:26

1 Answer 1

0

Do you have any error log? (it would be logging to default nginx error log - most probable /var/log/nginx/error.log )

I think the most probable you will get is:

"http" directive is not allowed here in ...

If I'm not wrong, you shouldn't include server directives inside http (just remove http{}) and please, add some error logs if it's not working after.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.