location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
I already have configuration with proxy, but i just need to add these headers to send them into internal server as described here Asp.Net Core Google authentication. Right now my config looks like this:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@some_domain.com
ServerName www.some_domain.com
ServerAlias some_domain.com
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:20006/
ProxyPassReverse / http://127.0.0.1:20006/
SSLCertificateFile /etc/letsencrypt/live/some_domain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/some_domain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/some_domain.com/chain.pem
</VirtualHost>
</IfModule>
Update:
I needed to add only one header:
RequestHeader set X-Forwarded-Proto "https"