I am trying to configure nginx as a reverse proxy for multiple servers on my LAN. They should go out on my WAN with different subdomains. My configuration looks like this:
@ReverseProxy:/etc/nginx/sites-enabled$ cat reverseproxy
server {
server_name DOMAIN.eu;
# app1 reverse proxy follow
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://10.0.2.5:80;
}
server {
server_name Subdomain.domain.eu;
# app2 reverse proxy settings follow
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://10.0.2.33:80;
}
But I am getting this error and can't get any further....
@ReverseProxy:/etc/nginx/sites-enabled$ nginx -t
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2009/01/04 12:22:13 [warn] 1302#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2009/01/04 12:22:13 [emerg] 1302#0: "proxy_pass" directive is not allowed here in /etc/nginx/sites-enabled/reverseproxy:8
nginx: configuration file /etc/nginx/nginx.conf test failed