Skip to content

Commit

Permalink
SSL configuration for nginx hosted servers.
Browse files Browse the repository at this point in the history
  • Loading branch information
perlDreamer committed Dec 31, 2011
1 parent c4fb3c9 commit 2a29bcb
Showing 1 changed file with 27 additions and 45 deletions.
72 changes: 27 additions & 45 deletions wre/var/setupfiles/nginx.template
Expand Up @@ -3,6 +3,10 @@ server {
server_name [% sitename %] [% domain %]; server_name [% sitename %] [% domain %];
access_log [% domainRoot %]/[% sitename %]/logs/access.log combined access_log [% domainRoot %]/[% sitename %]/logs/access.log combined


client_max_body_size 20M;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;

# block IIS related attacks from getting to WebGUI # block IIS related attacks from getting to WebGUI
location = /^scripts/ { location = /^scripts/ {
return 400 return 400
Expand All @@ -20,14 +24,6 @@ server {
return 400 return 400
} }


# leave static stuff (extras) to be served directly by modproxy (rule should be inherited from parent)
#RewriteRule ^/extras/ - [L]

# For speed we only pass on uploads if there is a .wgaccess file
RewriteCond %{REQUEST_FILENAME} ^(.*/)
RewriteCond %{DOCUMENT_ROOT}%1.wgaccess !-f
RewriteRule ^/uploads/ - [L]

# proxy webgui pages # proxy webgui pages
#ProxyPreserveHost On #ProxyPreserveHost On
#RewriteRule ^/(.*) http://127.0.0.1:[% modperlPort %]/$1 [P] #RewriteRule ^/(.*) http://127.0.0.1:[% modperlPort %]/$1 [P]
Expand All @@ -37,47 +33,33 @@ server {
# change the 10.0.0.1 to the IP address you wish to bind the SSL host # change the 10.0.0.1 to the IP address you wish to bind the SSL host
# to. # to.


#Listen 10.0.0.1:443 #server {
#<VirtualHost 10.0.0.1:443> # listen 443;
# ServerName [% sitename %] # server_name [% sitename %] [% domain %];
# CustomLog [% domainRoot %]/[% sitename %]/logs/access.log combined # access_log [% domainRoot %]/[% sitename %]/logs/access.log combined
# DocumentRoot [% domainRoot %]/[% sitename %]/public
# #
# # let modperl know we're using SSL # client_max_body_size 20M;
# RequestHeader add SSLPROXY "1" # proxy_set_header X-Real-IP $remote_addr;
# # proxy_set_header Host $host;
# # turn on mod_rewrite
# RewriteEngine On
# RewriteLog "[% wreRoot %]/var/logs/modrewrite.log"
# RewriteLogLevel 0
# #
# # block IIS related attacks from getting to WebGUI # # block IIS related attacks from getting to WebGUI
# RewriteRule ^/scripts/ - [L] # location = /^scripts/ {
# RewriteRule ^/default.ida - [L] # return 400
# RewriteRule ^/_vti_bin - [L] # }
# RewriteRule ^/_mem_bin - [L]
# #
# # leave static stuff to be served directly by modproxy # location = /^default.ida/ {
# RewriteRule ^/favicon.ico - [L] # return 400
# RewriteRule ^/extras/ - [L] # }
# #
# # For speed we only pass on uploads if there is a .wgaccess file # location = /_vti_bin/ {
# RewriteCond %{REQUEST_FILENAME} ^(.*/) # return 400
# RewriteCond %{DOCUMENT_ROOT}%1.wgaccess !-f # }
# RewriteRule ^/uploads/ - [L]
# #
# # proxy webgui pages # location = /_mem_bin/ {
# ProxyPreserveHost On # return 400
# RewriteRule ^/(.*) http://127.0.0.1:[% modperlPort %]/$1 [P] # }
# #
# # enable SSL # ssl_certificate [% domainRoot %]/[% sitename %]/certs/server.crt
# SSLEngine on # ssl_certificate_key [% domainRoot %]/[% sitename %]/certs/server.key
# SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL #
# SSLCertificateFile [% domainRoot %]/[% sitename %]/certs/server.crt #}
# SSLCertificateKeyFile [% domainRoot %]/[% sitename %]/certs/server.key
# SSLCACertificateFile [% domainRoot %]/[% sitename %]/certs/UTNAddTrustServerCA.crt
# SetEnvIf User-Agent ".*MSIE.*" \
# nokeepalive ssl-unclean-shutdown \
# downgrade-1.0 force-response-1.0
#</VirtualHost>

0 comments on commit 2a29bcb

Please sign in to comment.