-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nginx reverse proxying #122
Comments
Hey h1nk, thanks for opening this issue! I am not very experienced with Nginx but I'll try to help if I can. I don't think this is the issue but it might be useful to add this line after the line that starts with listen [::]:443 ssl http2 default_server; I saw you enabled TLS support, but did you specify the location of your TLS certificate(s)? You can do so by adding this code block (filling in the paths of the cert and key) after the ssl_certificate /etc/nginx/ssl/example.com.crt;
ssl_certificate_key /etc/nginx/ssl/example.com.key; Also, I think some other instances use jwilder/nginx-proxy as the reverse proxy which may suit your use case better (I found it to be easier but you may want more manual control). |
I am also trying to host libreddit behind nginx as a reverse proxy, and am being unsuccessful as well. I am planning on doing something different for SSL (I believe certbot with letsencrypt will work in my case and edit the file for me). Here is what I have:
I am receiving the same error from nginx as |
I think you may need to specify a port to listen on using: listen 80; |
Port |
The following setup reproduces the issue:
version: '3.8'
services:
nginx:
image: nginx
network_mode: host
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
libreddit:
image: spikecodes/libreddit
network_mode: host
|
@spikecodes maybe you could ask the community member you referred to in #16 (comment) what their |
I just updated the container and now I am getting the upstream error as well. |
@h1nk Thank you for this useful information! I was able to reproduce the error using the file contents that you provided. My apologies for not updating the README but Libreddit now uses Tide and no longer Actix Web. Using jbr's adivce, I was able to fix this by simply adding: proxy_http_version 1.1; Above the |
That worked on my end. Thanks @spikecodes! |
Great to hear! 😄 My pleasure! |
Just got hit with this, changing the proxy HTTP version works. Maybe mention this on the README, on the Deployment section? |
Thanks somini, that's a great idea! Just added. |
I saw some of the alternative instances are hosted behind Apache or nginx. I have had absolutely no success getting libreddit to work with nginx. I've been trying the following configuration to no avail:
I get a bad gateway on each index hit:
[error] 34#34: *93 upstream prematurely closed connection while reading response header from upstream
I'm running my instance from Docker and building the image off the latest master commit. The instance is accessible from both containers:
Any help getting this configuration to work would much appreciated.
The text was updated successfully, but these errors were encountered: