SA-MP Forums

Go Back   SA-MP Forums > SA-MP Server > Server Support

Reply
 
Thread Tools Display Modes
Old 21/01/2020, 05:32 PM   #1
Sasinosoft
Little Clucker
 
Sasinosoft's Avatar
 
Join Date: Jan 2020
Location: Tampa, FL
Posts: 27
Reputation: 1
Default Configuring Nginx to reverse-proxy SA-MP server

Hello,
I would like to know how can I configure Nginx to reverse-proxy SA-MP servers in Ubuntu 18.04.
Let's suppose I have 3 SA-MP Server instances running in the same computer; I would like them to be accessible all at the same port but with different names.

Example:
Code:
s1.name.com:7777 -> 100.90.80.70 -> Nginx cfg "s1.name.com" -> localhost:7777
s2.name.com:7777 -> 100.90.80.70 -> Nginx cfg "s2.name.com" -> localhost:7778
s3.name.com:7777 -> 100.90.80.70 -> Nginx cfg "s3.name.com" -> localhost:7779
Is it possible to do this? Thank you.
Sasinosoft is offline   Reply With Quote
Old 24/01/2020, 08:42 PM   #2
Markski
Big Clucker
 
Markski's Avatar
 
Join Date: Apr 2015
Location: La Plata, Argentina
Posts: 121
Reputation: 43
Default Re: Configuring Nginx to reverse-proxy SA-MP server

This one I used previously for HTTP requests, not sure if it'd work for SA-MP but might be worth a try, tweaked it a bit for your case...

HTML Code:
server {
    listen 7777;
    server_name s2.name.com;
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:7778;
    }
}
Markski is offline   Reply With Quote
Old 26/01/2020, 12:48 PM   #3
Sasinosoft
Little Clucker
 
Sasinosoft's Avatar
 
Join Date: Jan 2020
Location: Tampa, FL
Posts: 27
Reputation: 1
Default Re: Configuring Nginx to reverse-proxy SA-MP server

Quote:
Originally Posted by Markski View Post
This one I used previously for HTTP requests, not sure if it'd work for SA-MP but might be worth a try, tweaked it a bit for your case...

HTML Code:
server {
    listen 7777;
    server_name s2.name.com;
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:7778;
    }
}
Thanks, I will give it a try. Should I create a conf file in sites-available containing only this?
Sasinosoft is offline   Reply With Quote
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Configuring mysql stuffs on VPS biker122 Server Support 27 16/03/2015 12:25 PM
[FilterScript] [BETA] Anti Proxy [Over 15.000 Proxy Supported!] ColuiCheTiUccide Filterscripts 7 15/06/2014 02:55 PM
[Help] Proxy Server iRage Server Support 0 07/01/2014 12:33 PM
Configuring SQL through scriptfiles Luke_James Server Support 1 22/08/2012 06:55 PM


All times are GMT. The time now is 09:39 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.