Pls Help - Can't Hit My Server Endpoints From The Outside
October 18, 2024 09:14PM
Hi there!

So I originally posted my config files and have a huge thread back and forth here:

https://users.rust-lang.org/t/cant-connect-to-rust-executable-running-on-live-server/119939/12

Basically, I have a websocket server that runs on ws://0.0.0.0:8000/ws

I want to have ufw and nfinx to allow secure connections on wss and route to running running websocket process here.

I've tried what seems like every conbination of nginx config settings a endpoints but nothing works. Also in the final logs it seems like ufw is blocking things, but I have all these rules allowing many ports in ufw...

I am trying to use the domain with subdomain "quackers-beta.jimlynchcodes.com".

I can see locally that it is indeed running, but I just can't seem to access it from anywhere outside...

so what can I do to fix this? what are the proper nginx config settings I need

thanks
Re: Pls Help - Can't Hit My Server Endpoints From The Outside
October 18, 2024 09:16PM
This is what my nginx service config looks like. I've tried a LOT of different ones:

located at: /etc/nginx/sites-available/quackers-beta.jimlynchcodes.com

```
server {
listen 443 ssl;
server_name quackers-beta.jimlynchcodes.com;

ssl_certificate /etc/letsencrypt/live/quackers-beta.jimlynchcodes.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/quackers-beta.jimlynchcodes.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;

location /ws {
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 86400; # Prevent timeout for long-lived connections
}

location / {
proxy_pass http://0.0.0.0:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

error_log /var/log/nginx/quackers_error.log debug;
access_log /var/log/nginx/quackers_access.log;

}
```
Re: Pls Help - Can't Hit My Server Endpoints From The Outside
October 18, 2024 09:17PM
and here's my /etc/nginx/nginx.conf:

user www-data;
worker_processes auto;
worker_cpu_affinity auto;
pid /run/nginx.pid;
error_log /var/log/nginx/error.log debug;
include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 768;
# multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
server_tokens build; # Recommended practice is to turn this off

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# SSL Settings
##

ssl_protocols TLSv1.2 TLSv1.3; # Dropping SSLv3 (POODLE), TLS 1.0, 1.1
ssl_prefer_server_ciphers off; # Don't force server cipher order.

##
# Logging Settings
##

access_log /var/log/nginx/access.log;

##
# Gzip Settings
##

gzip on;

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}


#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
Re: Pls Help - Can't Hit My Server Endpoints From The Outside
October 21, 2024 06:59PM
guys, I fixed it!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 127
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready