In a previous post I shared a virtual host configuration for an Apache reverse proxy and thought I would do the same for Nginx.

Nginx is a very light weight and effective web server and reverse proxy!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 server {
 
    listen 443;
    listen  [::]:443;
    server_name www.somedomain.com somedomain.com;
 
    ssl_certificate           /etc/ssl/certs/cert.pem;
    ssl_certificate_key       /etc/ssl/certs/key.pem;
 
    ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;
 
    access_log            /var/log/nginx/somedomain.com.access.log;
 
    proxy_set_header HOST $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Custom-XFF $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 
 location / {
      # Fix the “It appears that your reverse proxy set up is broken" error.
      proxy_pass          https://10.0.1.10:443;
      proxy_read_timeout  90;
 
    }
  }

Leave a Reply

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.