Sam
July 20, 2017, 4:36pm
1
Hello,
We have a competing consumer persistent subscription using Event Store 4.0.1.0 with nginx in front.
Our config must be wrong because when getting the feed using: application/vnd.eventstore.competingatom+json , but the url’s come back with the internal. I am assuming there is a config for relative urls?
Currently getting:
**http://localhost:2113/**subscriptions/test-stream-name/test-subscription/ack/ae71ac92-9f69-40eb-8223-eebffa07cf9e
Expected:
**https://externaltest:443/**subscriptions/test-stream-name/test-subscription/ack/ae71ac92-9f69-40eb-8223-eebffa07cf9e
I tried modifying ExtHttpPrefixes in eventstore.conf, but it did not seem to help.
Any guidance on nginx + eventstore config would be greatly appreciated.
Thanks,
Sam
What is your config/nginx config?
Sam
July 20, 2017, 5:18pm
3
Sorry, I should have checked the nginx proxy config. Thanks for helping pinpoint it! Maybe I can help drop this in a Cookbook or Wiki?
This is what I had:
server {
listen 443 ssl default deferred;
server_name externaltest;
ssl on;
proxy_intercept_errors on;
location / {
proxy_pass http://localhost:2113/;
}
}
This works!:
server {
listen 443 ssl default deferred;
server_name externaltest;
ssl on;
proxy_intercept_errors on;
location / {
proxy_pass http://localhost:2113/;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Sam
I think it would be a useful addition to documents maybe as a recipe etc.
Sam
July 20, 2017, 5:26pm
5
One more X header for the port:
server {
listen 443 ssl default deferred;
server_name externaltest;
ssl on;
proxy_intercept_errors on;
location / {
proxy_pass http://localhost:2113/ ;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}