AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   SourceBans / SourceBans++ (https://forums.alliedmods.net/forumdisplay.php?f=152)
-   -   SOLVED [NGINX] Setup config (https://forums.alliedmods.net/showthread.php?t=328216)

SpirT 10-31-2020 14:37

SOLVED [NGINX] Setup config
 
Hey.

I am trying to setup sourcebans on my vps. I have nginx & php 7.4 installed.

My config has the following: (I'll install SSL later)
Code:

server {
        listen 80;

        server_name bans.website.com;

        root /var/www/bans;
        index index.php index.html;

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

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php7.4-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;
        include /etc/nginx/fastcgi_params;
    }
}

When I try to access the website with the url it just downloads a file like this -> https://prnt.sc/vaua1z

Any ideas for the fix?

Best Regards,

SpirT.

HvG Community 12-17-2020 00:50

Re: [NGINX] Setup config
 
Code:

 
location /sourcebans{
    proxy_pass http://127.0.0.1:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
  }


SpirT 12-21-2020 07:47

Re: [NGINX] Setup config
 
Quote:

Originally Posted by HvG Community (Post 2729011)
Code:

 
location /sourcebans{
    proxy_pass http://127.0.0.1:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
  }


That was not the issue, once the proxy pass was already the php socket. The issue was that sourcebans was asking for 5.5 as recommended and I was using 7.4 (the latest at that time). I did some research and find out that the version is too new for sourcebans and that I should downgrade. Therefore I have php 5.6 and 7.4 running on my machine and sourcebans is running with php 5.6 with no errors at all!

HvG Community 12-23-2020 06:07

Re: SOLVED [NGINX] Setup config
 
I had this exact issue, the file would download and that was because of faulty nginx config.

I later had the issue you mention with PHP version being too high but I kept using it and just edited some parts of sourceban that were not compatible.

SpirT 12-27-2020 14:42

Re: SOLVED [NGINX] Setup config
 
Quote:

Originally Posted by HvG Community (Post 2729849)
I had this exact issue, the file would download and that was because of faulty nginx config.

I later had the issue you mention with PHP version being too high but I kept using it and just edited some parts of sourceban that were not compatible.

I never had experience with php code, therefore I never edited the source...
But yeah, at least I got a solution


All times are GMT -4. The time now is 17:10.

Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.