#nginx help

83 messages · Page 1 of 1 (latest)

lunar scaffold
#

Remove the part of your server block that's listening on port 80.

rough oyster
#

like what

#

bc on my mobilizen config it is commented out

#

mobilizon*

#

and there is no part for port 80

lunar scaffold
#

Can you send the entire .conf file?

rough oyster
#

ok.. it will take a sec

lunar scaffold
#

I'll be on PC in about 30min anyways, I'll be back then.

rough oyster
#

@lunar scaffold is anything wrong with my confs??

#

??

lunar scaffold
#

This is the default server block. Try this for your pterodactyl.conf and see if it works. If it does, you'll have narrowed the problem down to the pterodactyl server block.

server {
    # Replace the example <domain> with your domain name or IP address
    listen 80;
    server_name 192.168.1.46;


    root /var/www/pterodactyl/public;
    index index.html index.htm index.php;
    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/pterodactyl.app-error.log error;

    # allow larger file uploads and longer script runtimes
    client_max_body_size 100m;
    client_body_timeout 120s;

    sendfile off;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTP_PROXY "";
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
    }

    location ~ /\.ht {
        deny all;
    }
}
rough oyster
#

ok

#

i'll try it

rough oyster
#

i recrated the ticked bc i accidentally deleted this one

lunar scaffold
#

What is the output of ip a on your panel machine?

rough oyster
lunar scaffold
#

It looks like it's the right address and the server blocks look correct. I'm at a loss.

rough oyster
#

me too

#

bc i also tried looking at the default mobilizon confg

lunar scaffold
#

There's nothing I can see in the mobzilon.conf that would redirect traffic, but in case I'm wrong try renaming it to mobzilon.bak, restart nginx, and see if it works with that site disables.

rough oyster
#

but no luck

#

ok

lunar scaffold
#

Also are you using the default.conf for anything? The Pterodactyl Installation Docs say to delete it.

rough oyster
#

oh miss that

#

let me delete that

#

eb 12 19:58:26 linux5 systemd[1]: Reload failed for A high performance web server and a reverse proxy server.
nginx spits this pout when i reload

#

and fails

lunar scaffold
#

Maybe move the mobzilon.bak out of the folder entirely

#

Just the pterodactyl.conf in there

rough oyster
#

ok

#

still spits the same error

lunar scaffold
#

nginx -t should give you more information about what it doesn't like

rough oyster
#

nginx: [emerg] open() "/etc/nginx/sites-enabled/mobilizon.conf" failed (2: No such file or directory) in /etc/nginx/nginx.conf:64

lunar scaffold
#

What is in nginx.conf?

rough oyster
#
nginx: configuration file /etc/nginx/nginx.conf test failed```
lunar scaffold
#

It appears to be looking for it

rough oyster
#

as it should be i guess

lunar scaffold
#

Is mobzilon.conf referenced in /etc/nginx/nginx.conf? What does the file look like?

Is mobzilon.conf gone from both sites-enabled and sites-available?

rough oyster
#

not from enabled

lunar scaffold
#

Remove it from enabled too

rough oyster
#

done

lunar scaffold
#

I believe the sites-available one is a symbolic link to the one in sites-enabled

#

nginx -t

rough oyster
#

now reloads

lunar scaffold
#

Does the panel work?

rough oyster
#

no

lunar scaffold
#

Now that it can't redirect you to mobzilon, what is the error message?

rough oyster
lunar scaffold
#

What ip are you using to connect to it?

rough oyster
#

192.168.1.46

lunar scaffold
#

huh

rough oyster
#

bc the only acces is in LAN

#

bc i do not want it on the internet

#

even with nginx stopped it does the same thing

lunar scaffold
#

Have you tried on a new private tab in your browser? It may just be old cache.

rough oyster
#

no

#

thnks god you hero

#

pld up

#

imma try putting the old configs

#

like the mobilizon

lunar scaffold
#

You can also try modfying the Pterodactyl.conf file so port 80 is specified, as so:

server {
    listen 80;
    listen [::]:80;

    server_name 192.168.1.46;

    root /var/www/pterodactyl/public;
    index index.html index.htm index.php;
    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    proxy_pass http://192.168.1.46:80;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/pterodactyl.app-error.log error;

    # allow larger file uploads and longer script runtimes
    client_max_body_size 100m;
    client_body_timeout 120s;

    sendfile off;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTP_PROXY "";
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
    }

    location ~ /\.ht {
        deny all;
    }
}
rough oyster
#

ok let me try

jaunty shuttleBOT
#

I have found the following for: https://media.discordapp.net/attachments/1074383095710621777/1074407651519238185/image.png
You will normally see 502 bad gateway error when php-fpm can't be reached by your web server. This can be due to a wrong path, it not running or wrong permissions. Confirm that it is running and using the correct php-fpm version in the config pterodactyl.conf file. It would be attempting to use PHP 8.1 by default. When using other PHP versions, make sure to change the php-fpm version in your config to match your used PHP version.

Not sure where to find the server block file? Type .webconf and I will respond with more instructions. Web server error logs can provide additional details.

rough oyster
#

but mannualy putting the path does the job

lunar scaffold
#

huh

rough oyster
#

done it just added /auth/login to the proxy_pass

lunar scaffold
#

Nice

rough oyster
lunar scaffold
#

Now you should be good to add the mobzilon.conf back

rough oyster
#

now i have to diagnose MOB

rough oyster
#

THANKS A LOT

lunar scaffold
#

No problem