I recently uninstalled apache2 for Nginx
I'm trying to listen on 88, 808 and 888 for my sites and redirect different subdomains for each (and another domain to another server).
The other domain is going to another computer on my local network and the different ports goes to different servers on the same computer (most are not served by nginx)
I did a netstat and Nginx is listening to the different ports.
The problem is that Nginx is giving bad gateway for all proxied requests and timeout for the direct ip access.
proxy conf : --> otherdomain.fr = eror 502 bad gateway
# HTTP
server {
# Listen on ipv4
listen 80;
#listen [::]:80;
server_name ~.*.otherdomain.fr;
location / {
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://192.168.1.17";
}
}
server{
listen 80;
server_name nextcloud.domain.me;
location / {
proxy_set_header Host $host;
proxy_pass "http://127.0.0.1:888";
proxy_redirect off;
}
}
server{
listen 80;
server_name domain.me;
location / {
proxy_set_header Host $host;
proxy_pass "http://127.0.0.1:808";
proxy_redirect off;
}
}
ex for port 88: --> ip:88 = timeout
(obviously, it is enabled and the nginx user have access to the files)
server {
# Listen on ipv4
listen 88;
location / {
root /var/www/html/tests;
}
}
Question : I'm obviously doing something wrong but I cant find out what, if you could give me a hand it would be incredible. Thank you in advance!