M
M
Meliborn2019-04-14 23:03:12
Nginx
Meliborn, 2019-04-14 23:03:12

Nginx and remote upstream?

I have a rail application with nginx on DigitalOcean, all on the same host. By virtue of the insanity laws of Belarus, I am obliged to be hosted by two and a half local hosts, which have tariffs like 5 sites for php + 1 base, or VDS for 100 bucks.
What I want is to take the cheapest vds, raise nginx there and forward all incoming to the current host, do not transfer anything anywhere. Is it real? How to set up a config? Will the delay increase a lot?
Do I just need to transfer the domain to a new ip?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danil Sapegin, 2019-04-15
@ynblpb_spb

Blocking DigitalOcean?
Here I wrote the answer, this solution will help you.
rewrite the domain to the IP of the new server and that's it.

A
abmanimenja, 2019-04-15
@abmanimenja

Can be done with proxying and caching.

location / {
    resolver 8.8.8.8;
    
    proxy_cache my_cache;

    proxy_pass https://original.example.com;
    proxy_redirect off;

    proxy_intercept_errors on;

    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header Host original.example.com;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question