server {
listen 80;
server_name public-service.com;
location / {
access_log off;
proxy_pass https://example.com/public-service;
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_redirect default;
}
}
rewrite ^ /public-service/ break;
proxy_pass https://example.com;
proxy_set_header Host $host;
httpS://public-service.com
так что нужен не listen 80;
, а listen 443 ssl;
.