Created
February 22, 2017 01:21
-
-
Save shams-ali/8370112944a1c9a78a465f9d7d3b2a7c to your computer and use it in GitHub Desktop.
nginx config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#new bondfar | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
client_max_body_size 500M; | |
upstream nodeapp { | |
# private IP | |
server 172.31.28.196:3000; | |
} | |
server { | |
listen 80 default_server; | |
server_name bondfar.com; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
# SSL/HTTPS | |
# uncomment below to enable self-signed certs | |
listen 443 ssl; | |
server_name bondfar.com; | |
ssl on; | |
ssl_certificate /etc/letsencrypt/live/www.bondfar.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/www.bondfar.com/privkey.pem; | |
location / { | |
proxy_pass http://nodeapp; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} | |
} | |
} | |
############################################################# | |
#lcjc old | |
user www-data; | |
worker_processes auto; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} | |
http { | |
## | |
# Basic Settings | |
## | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 65; | |
types_hash_max_size 2048; | |
# server_tokens off; | |
# server_names_hash_bucket_size 64; | |
# server_name_in_redirect off; | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
## | |
# SSL Settings | |
## | |
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE | |
#ssl_prefer_server_ciphers on; | |
## | |
# Logging Settings | |
## | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
## | |
# Gzip Settings | |
## | |
gzip on; | |
gzip_disable "msie6"; | |
# gzip_vary on; | |
# gzip_proxied any; | |
# gzip_comp_level 6; | |
# gzip_buffers 16 8k; | |
# gzip_http_version 1.1; | |
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; | |
## | |
# Virtual Host Configs | |
## | |
#include /etc/nginx/conf.d/*.conf; | |
#include /etc/nginx/sites-enabled/*; | |
server { | |
listen 443; | |
server_name laruralhelpdesk.laciviljustice.org; | |
ssl on; | |
ssl_certificate /etc/apache2/ssl/apache.crt; | |
ssl_certificate_key /etc/apache2/ssl/apache.key; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
location / { | |
proxy_pass http://127.0.0.1:8100; | |
} | |
} | |
server { | |
listen 80; | |
server_name laruralhelpdesk.laciviljustice.org; | |
#ssl on; | |
#ssl_certificate /etc/apache2/ssl/apache.crt; | |
#ssl_certificate_key /etc/apache2/ssl/apache.key; | |
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
#return 301 https://laruralhelpdesk.laciviljustice.org$request_uri; | |
location / { | |
proxy_pass http://127.0.0.1:8100; | |
} | |
} | |
} | |
#################################################### | |
#opspark website | |
# You may add here your | |
# server { | |
# ... | |
# } | |
# statements for each of your virtual hosts to this file | |
server { | |
listen 80; | |
server_name operationspark.org; | |
return 301 http://operationspark.org$request_uri; | |
location / { | |
proxy_pass http://localhost:9000; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} | |
} | |
# HTTPS server | |
server { | |
listen 443 ssl; | |
listen [::]:443 ssl; | |
server_name operationspark.org; | |
ssl_certificate "/etc/letsencrypt/live/operationspark.org/fullchain.pem"; | |
ssl_certificate_key "/etc/letsencrypt/live/operationspark.org/privkey.pem"; | |
# It is *strongly* recommended to generate unique DH parameters | |
# Generate them with: openssl dhparam -out /etc/pki/nginx/dhparams.pem 2048 | |
#ssl_dhparam "/etc/pki/nginx/dhparams.pem"; | |
ssl_session_cache shared:SSL:1m; | |
ssl_session_timeout 10m; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP; | |
ssl_prefer_server_ciphers on; | |
error_page 497 https://$host:$server_port$request_uri; | |
location / { | |
proxy_pass http://localhost:9000; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment