Skip to content

Instantly share code, notes, and snippets.

@Unitech
Created June 20, 2014 10:37
Show Gist options
  • Save Unitech/170b16cae0775392df90 to your computer and use it in GitHub Desktop.
Save Unitech/170b16cae0775392df90 to your computer and use it in GitHub Desktop.
nginx.conf
#user nobody;
worker_processes auto;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
tcp_nodelay on;
client_max_body_size 100m;
server_names_hash_bucket_size 64;
gzip on;
gzip_http_version 1.0;
gzip_comp_level 6;
gzip_vary on;
gzip_proxied any;
gzip_min_length 1000;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_disable "MSIE [1-6].(?!.*SV1)";
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
server {
listen 443 ssl;
ssl on;
keepalive_timeout 70;
ssl_certificate /keys/unitech-gandi.csr;
ssl_certificate_key /keys/unitech-key.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
server_name unitech.io www.unitech.io;
location / {
root /var/www/Unitech.io/home;
index index.html index.htm;
}
}
upstream seoCDN{
server 127.0.0.1:900;
}
server {
listen 80;
server_name unitech.io www.unitech.io;
location / {
root /var/www/Unitech.io/UnitechWebsite/app;
try_files $uri $uri/ /index.html =404;
}
if ($args ~ "_escaped_fragment_=(.*)") {
rewrite ^ /snapshot${uri};
}
location /snapshot {
proxy_pass http://seoCDN;
proxy_connect_timeout 60s;
}
}
server {
listen 80;
server_name cdn.unitech.io www.cdn.unitech.io;
# rewrite ^ https://$server_name$request_uri? permanent;
location / {
root /var/www/unitech-logo;
index index.html index.htm;
}
}
upstream blog{
server 127.0.0.1:2368;
}
server {
listen 80;
server_name as.unitech.io www.as.unitech.io;
location ~* \.(png|jpg|jpeg|gif|ico)$ {
expires 1y;
log_not_found off;
proxy_pass http://blog;
}
location / {
proxy_pass http://blog;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment