Post more logs/configs
Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
What kind of logs should I post?
The ones from the applications which should do the proxying and serving.
BTW: you're using both Nginx Proxy Manager and Nginx in parallel? Native installations, docker, something else?
How are they configured?
nginx proxy manager's in a docker container reverse proxying my nginx docker containers, and native nginx is reverse proxying snikket container because nginx proxy manager doesn't go well with snikket.
Here's the nginx config for my snikket.
server { # Accept HTTP connections listen 80;
listen [::]:80;
server_name chat.allinuxuser.xyz;
server_name groups.chat.allinuxuser.xyz;
server_name share.chat.allinuxuser.xyz;
location / { proxy_pass http://localhost:5080/; proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# This is the maximum size of uploaded files in Snikket
client_max_body_size 104857616; # 100MB + 16 bytes }
} server { # Accept HTTPS connections
listen [::]:443 ssl; listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/allinuxuser.xyz-0001/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/allinuxuser.xyz-0001/privkey.pem;
server_name chat.allinuxuser.xyz; server_name groups.chat.allinuxuser.xyz;
server_name share.chat.allinuxuser.xyz;
location / {
proxy_pass https://localhost:5443/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# REMOVE THIS IF YOU CHANGE `localhost` TO ANYTHING ELSE ABOVE
proxy_ssl_verify off;
proxy_set_header X-Forwarded-Proto https;
proxy_ssl_server_name on;
# This is the maximum size of uploaded files in Snikket
client_max_body_size 104857616; # 100MB + 16 bytes
# For BOSH and WebSockets
proxy_set_header Connection $http_connection;
proxy_set_header Upgrade $http_upgrade;
proxy_read_timeout 900s;
}
}
Here's the docker-compose for one of the sites i'm running that's been affected by the weird nginx error.
version: "3" services:
client: image: nginx
restart: unless-stopped ports:
- 5973:80 volumes:
- ./allinuxuser-website:/usr/share/nginx/html
Please tell me if there's any more logs I need to provide.
So your native nginx process covers ports 80 and 443. which ports does your NPM use? Are you trying to use the same ports? Because that'll most likely clash.
services:
app:
image: 'jc21/nginx-proxy-manager:latest' restart: unless-stopped
ports: - '325:80'
- '81:81' - '326:443'
volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt
I mean I got them portmapped to other ports so... I dunno
find out which process is really binding to 443 if you don't recognize that port as being used
sudo ss -unapt | grep 443
tcp LISTEN 0 4096 0.0.0.0:9443 0.0.0.0:* users:(("docker-proxy",pid=1550,fd=4)) tcp LISTEN 0 511 0.0.0.0:443 0.0.0.0:* users:(("nginx",pid=2511847,fd=6),("nginx",pid=2511846,fd=6),("nginx",pid=2511845,fd=6),("nginx",pid=2511844,fd=6),("nginx",pid=2511843,fd=6)) tcp LISTEN 0 511 0.0.0.0:5443 0.0.0.0:* users:(("nginx",pid=2540528,fd=6),("nginx",pid=2540399,fd=6)) tcp LAST-ACK 0 1 192.168.0.107:443 91.84.87.137:40016 tcp LISTEN 0 4096 [::]:9443 [::]:* users:(("docker-proxy",pid=1560,fd=4)) tcp LISTEN 0 511 [::]:443 [::]:* users:(("nginx",pid=2511847,fd=5),("nginx",pid=2511846,fd=5),("nginx",pid=2511845,fd=5),("nginx",pid=2511844,fd=5),("nginx",pid=2511843,fd=5)) tcp LISTEN 0 511 [::]:5443 [::]:* users:(("nginx",pid=2540528,fd=7),("nginx",pid=2540399,fd=7))
I don't know how to even interpret this, I know it says nginx but which nginx?? I got like 4 nginx web servers running
you do have an nginx process with PID 2511847
using the port
get more info with
ps aux | grep 2511847
or kill it, if you need to spawn a new one with the right configuration
apparently it's my native nginx.... wtf. I used
sudo systemctl stop nginx
And the websites that had the nginx error went down. I don't know how this could even happen? My containers use their own nginxes??? Maybe the mix of native nginx and docker nginx is messing everything up, if I can't find a solution I'm probably gonna nuke my native nginx and use docker nginx for all of my nginx needs
You'll have to look by pid or command line.