Learn about Centmin Mod LEMP Stack today
Become a Member

Nginx How to run a location from different nginx server ?

Discussion in 'Nginx and PHP-FPM news & discussions' started by negative, Mar 3, 2016.

Tags:
  1. negative

    negative Active Member

    415
    50
    28
    Apr 11, 2015
    Ratings:
    +98
    Local Time:
    9:13 AM
    1.9.10
    10.1.11
    Hello everyone!
    I want to run a "location" from another web server in nginx.

    I would like explain that with example:
    10.0.0.1 and 10.0.0.2 both webserver ( they have centmin mod nginx php etc. everything are same)

    Normally, i publish my website (portal + forum) from 10.0.0.1
    My forum directory is /forum/ in homedir. (it is not subdomain, it is subfolder)

    I want to run only /forum/ location from 10.0.0.2 (my another webserver). I think it maybe with proxy_pass or fastcgi pass i dont now exactly.

    I have tried some parameters like "proxy_pass" but i didn't it

    How can i do that ?


    Thanks.
     
  2. eva2000

    eva2000 Administrator Staff Member

    55,811
    12,273
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,859
    Local Time:
    4:13 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Centmin Mod is provide as is, so short of scripted related bugs or issues, any further optimisation to the web stack components - nginx, php-fpm, mariadb mysql, csf firewall etc or web app specific configurations are left to the Centmin Mod user to deal with. So I do not provide any free support for such.

    However, Centmin Mod users are free to help each other out and ask questions or give answers on this community forum. My hopes are that this community forum evolves so that more veteran long time Centmin Mod users help new Centmin Mod users out :)

    For nginx reverse proxy read the documentation, tutorial and guides below
    Of course, that's why i have forums and blogs on subdomains, so can use separate servers without needing a reverse proxy :)
     
  3. negative

    negative Active Member

    415
    50
    28
    Apr 11, 2015
    Ratings:
    +98
    Local Time:
    9:13 AM
    1.9.10
    10.1.11
    Hello, please don't get me wrong! I don't want to take free support from you already. I write here because someone may help me about this process.

    I'm sorry that because i'm not using subdomain :) But i think, there is a way for run a subfolder from different server too.

    Thank you anyway @eva2000
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,811
    12,273
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,859
    Local Time:
    4:13 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    no probs, just general statement as other folks may come across this thread in future :)

    but my links above have all you need :D
     
  5. negative

    negative Active Member

    415
    50
    28
    Apr 11, 2015
    Ratings:
    +98
    Local Time:
    9:13 AM
    1.9.10
    10.1.11
    Yes but i can't do it :) Because, for example when i tried that

    Code:
    location /forum {
        proxy_pass http://10.0.0.2;
    }
    Then, forum directory can't open also 404 because 10.0.0.2 default page is not my nginx domains public directory. It is default "Centmin Mod Nginx Test Page"

    So i think, i should do that call my website from ip address too. Am i right ?

    P.S: Need that small help from you :D
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,811
    12,273
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,859
    Local Time:
    4:13 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Answers are all in the linked documentation I posted is all I'd say ;)