Too many redirects when using a nginx reverce proxy #179
-
|
Hi, Dave! I can't solve the problem with endless redirects to https when using freescout in a container preceded by a reverse proxy. The scheme is simple: I have nginx on the same host, which performs SSL functions and just proxies requests to other containers. I use several containers this way and everything works fine there. But the container with freescout I am having trouble getting up and running. Here is the server configuration of my nginx server: And here is the configuration of the freescout container: I removed some docker-compose environment variables, such as database connection settings, etc., so as not to clutter up the text. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
A few days later found the answer to my own question. server {
listen 443 ssl;
server_name my.domain.name;
include ssl.conf;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:8088;
}
} |
Beta Was this translation helpful? Give feedback.
A few days later found the answer to my own question.
It's all about the mandatory
X-Forwarded-Protoheader. This header must convey the current protocol. So the working variant of nginx-proxy looks as follows: