Page 1 of 1

Reverse Proxy Setup

Posted: Thu Mar 05, 2015 6:14 pm
by Vincenzo
Hi, I have several domains that use port # 8069, 8200 and 8300... In Apache I know how to create the reverse proxy however recently I installed Vesta CP and I cant seem to figure out how to make the reverse proxy work using Vesta CP.
I allowed the port to work from the firewall so I can test it and it works fine, however where do I add the reverse proxy info? Can someone please help me?

Thank you,


Vincenzo

Re: Reverse Proxy Setup

Posted: Thu Mar 05, 2015 8:05 pm
by skurudo
You already have reverse proxy - nginx
In conf file make port, which you need

For example - /home/admin/conf/web/nginx.conf

location / {
proxy_pass http://ip:port-you-need;

Make sure you have application on this port in apache or something else

Re: Reverse Proxy Setup

Posted: Thu Mar 05, 2015 8:45 pm
by Vincenzo
when I pasted the script you gave me, and added the port the nginx server wont restart. any ideas? can you give a complete sample?

Re: Reverse Proxy Setup

Posted: Fri Mar 06, 2015 1:56 am
by skurudo
Because It's non complete config, man. Don't copy-paste all you see on forum, if you don't completly understand, what you do. It's a bad habbit.

First add domain, then edit config.
There is location section (search for this part):

Code: Select all

    location / {
        proxy_pass      http://your-ip:your-port;
        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|$
            root           /home/admin/web/juvia.ru/public_html;
            access_log     /var/log/apache2/domains/domain.ru.log combined;
            access_log     /var/log/apache2/domains/domain.ru.bytes bytes;
            expires        max;
            try_files      $uri @fallback;
        }
    }
Read a litttle about nginx - http://wiki.nginx.org/Configuration

Re: Reverse Proxy Setup

Posted: Fri Mar 06, 2015 11:42 pm
by Vincenzo
Thank you, worked like a charm