Browse Source

more complete nginx sample

pull/1/head
Nicolae Claudius 13 years ago
parent
commit
6d1550779e
  1. 43
      config/nginx.sample.conf

43
config/nginx.sample.conf

@ -1,11 +1,22 @@
# server
server {
listen 213.229.74.105:80;
server_name entrydns.net;
server_name entrydns.org;
server_name www.entrydns.net;
server_name www.entrydns.org;
# max body size
client_max_body_size 1m;
rewrite ^(.*) https://$server_name$1 permanent;
# always redirects to entrydns.net
if ($host != 'entrydns.net') {
rewrite ^/(.*)$ http://entrydns.net/$1 permanent;
}
location / {
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Host $host;
@ -14,3 +25,35 @@ server {
proxy_pass http://127.0.0.1;
}
}
# ssl
server {
listen 213.229.74.105:443;
server_name entrydns.net;
server_name entrydns.org;
server_name www.entrydns.net;
server_name www.entrydns.org;
# max body size
client_max_body_size 1m;
ssl on;
ssl_certificate /etc/pki/tls/certs/entrydns.net-crt.pem;
ssl_certificate_key /etc/pki/tls/private/entrydns.net-key.pem;
# rewrite ^(.*) https://$server_name$1 permanent;
# always redirects to entrydns.net
if ($host != 'entrydns.net') {
rewrite ^/(.*)$ https://entrydns.net/$1 permanent;
}
location / {
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1;
}
}

Loading…
Cancel
Save