Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Nginx Reverse Proxy

stasistasi Member
edited September 2016 in Help

Hey leb-ians,

I am having a little problem with setting up my first rproxy.

I am trying to put a ddos protected vps infront of a unprotected one.

my setup:
-domain.com (points to IP_Adress_2, https letsencrypt)

-vps1 (unprotected, IP_Adress_1, lemp)

-vps2 (ddos protected, IP_Adress_2, nginx)

this my /etc/nginx/conf.d/default.conf on vps2:

 server {
 listen       IP_Adress_2;
 server_name  domain.com www.domain.com;
 rewrite ^(.*) https://domain.com$1 permanent;

 access_log  off;
 error_log  off;
 root   /usr/share/nginx/html;
 index  index.html index.htm;


 location / {
 proxy_pass  https://IP_Adress_1;
 proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
 proxy_redirect off;
 proxy_buffering off;
 proxy_set_header        Host            $host;
 proxy_set_header        X-Real-IP       $remote_addr;
 proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;

}

}

can you please help me out :(

Comments

  • first part seems very much looping itself... you probably need to separate into twi different blocks.

    one block listening to port 80 for non-ssl requests, where might put your rewrite to https

    and another listening on port 443 for ssl request, which also would need to have ssl on declared and path to your certificate etc.

  • "I am having a little problem" -> what's the problem?

Sign In or Register to comment.