I just move my setup (personal web + different services) to a more powerful server.
I copy and paste some setup I made before like my nginx configuration for 3 web site I host (my personal + 2 services as subdomain).
I try to figure it out but something wrong happend.
Let say I have my own web site xxx.com. I manage to redirect every www request to non-www (it's not working now).
Plus now when I try to hit this web site I got a redirect to my subdomain yyy.xxx.com.
I give you my two server blocks :
Main web site :
server {
listen 80;
listen [::]:80;
server_name gfelot.xyz www.gfelot.xyz;
return 301 https://gfelot.xyz$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
include snippets/ssl-gfelot.xyz.conf;
include snippets/ssl-params.conf;
server_name gfelot.xyz;
access_log /var/log/nginx/gfelot.xyz.access.log;
error_log /var/log/nginx/gfelot.xyz.log;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~* \.css$ {
access_log off;
expires 1M;
add_header Pragma public;
add_header Cache-Control public;
add_header Vary Accept-Encoding;
}
}
Transmission service :
server {
listen 80;
listen [::]:80;
server_name dl.gfelot.xyz www.dl.gfelot.xyz;
return 301 https://dl.gfelot.xyz$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
include snippets/ssl-gfelot.xyz.conf;
include snippets/ssl-params.conf;
server_name dl.gfelot.xyz
access_log off;
error_log /var/log/nginx/dl.gfelot.xyz.log;
location / {
proxy_pass http://127.0.0.1:9091/web/;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass_header X-Transmission-Session-Id;
}
location /rpc {
proxy_pass http://127.0.0.1:9091/rpc;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass_header X-Transmission-Session-Id;
}
}
I dunno what's wrong with this configuration. And the weird thing is, it was working well before.