Raised This Month: $12 Target: $400
 3% 

SOLVED [NGINX] Setup config


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 10-31-2020 , 14:37   SOLVED [NGINX] Setup config
Reply With Quote #1

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.
__________________

Last edited by SpirT; 12-22-2020 at 05:38.
SpirT is offline
HvG Community
AlliedModders Donor
Join Date: Sep 2012
Old 12-17-2020 , 00:50   Re: [NGINX] Setup config
Reply With Quote #2

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;
  }
HvG Community is offline
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 12-21-2020 , 07:47   Re: [NGINX] Setup config
Reply With Quote #3

Quote:
Originally Posted by HvG Community View Post
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!
__________________

Last edited by SpirT; 12-22-2020 at 05:38.
SpirT is offline
HvG Community
AlliedModders Donor
Join Date: Sep 2012
Old 12-23-2020 , 06:07   Re: SOLVED [NGINX] Setup config
Reply With Quote #4

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.
HvG Community is offline
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 12-27-2020 , 14:42   Re: SOLVED [NGINX] Setup config
Reply With Quote #5

Quote:
Originally Posted by HvG Community View Post
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
__________________
SpirT is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode