Hello,
i have a VPS with an nginx reverse proxy and an another server where a myBB board is running. The reverse proxy is intended to protect the actual environment.
i need a reverse proxy that redirect http requests https (that's working) and forwards https requests (forum.example.de) to a remote server.
But unfortunately I can't manage it. I keep ending up on the Nginx default page.
What's wrong with the config?
http {
upstream mybb {
server 1.1.1.1;
}
server {
listen 80;
listen [::]:80;
server_name proxy.example.de;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name proxy.example.de;
ssl_certificate /usr/local/nginx/server.crt;
ssl_certificate_key /usr/local/nginx/server.key;
location /myBB {
proxy_pass http://forum.example.de;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}