Reputation: 71
I want to set up a proxy by using nginx.and I want to use a remote server on internet to be my backend server, is this possible for Nginx?
i.e. both the client and the backend server are on the internet.
i the config is somewhat like the following:
server {
listen 443 ssl;
server_name localhost;
ssl_certificate cert.pem;
ssl_certificate_key cert.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://www.google.com;
#Proxy Settings
proxy_redirect 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;
#proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_max_temp_file_size 0;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
Upvotes: 0
Views: 107
Reputation: 375
Sure
upstream your-domain.de {
## network
server 8.8.8.8:80;
}
server {
server_name your-domain2.de;
listen 80 ;
location / {
proxy_pass http://your-domain.de;
}}
You can do all sorts of things like ignoring cors etc with the right params but this is the baseline
Upvotes: 1