D
D
dulatus2017-09-17 01:54:41
Nginx
dulatus, 2017-09-17 01:54:41

Redirect example.com:5000 to https://sercure_example.com/admin?

Hello. There is an electron.js desktop application that makes a request to the example.com:5000 front , needs a redirect to https://secure_example.com/admin. There is no way to reinstall the app. You need to make sure that the front service on front:5000 is available on another domain /admin. When trying to go to http://example.com:5000 in the browser, it redirects as it should to https://secure_example.com/admin , but in the pm2 logs it shows:
1|buildAdm | GET /admin 200 6.911 ms
and I need a request to /
server {
server_name example.com;
listen 5000;
return 301https://secure_example/admin$request_uri;
}
server {
server_name secure_example.com;
listen 443;
ssl on;
….
location /admin {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
proxy_read_timeout 30s;
proxy_redirect off;
proxy_pass http://front:5000;
}
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question