user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
#include /etc/nginx/conf.d/*.conf;
server {
listen 80;
server_name www.rbtnet.com;
charset utf-8;
client_max_body_size 50m;
return 301 https://$server_name$request_uri;
}
server {
listen 80;
server_name rbtnet.com;
charset utf-8;
client_max_body_size 50m;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name www.rbtnet.com;
charset utf-8;
client_max_body_size 50m;
ssl_certificate /cert/www.rbtnet.com.pem;
ssl_certificate_key /cert/www.rbtnet.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_prefer_server_ciphers on;
location /blog {
alias /blog;
}
location / {
proxy_pass http://www.rbtnet.com:8080;
proxy_set_header x-forwarded-for $remote_addr;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
}
location /websocket {
proxy_pass http://www.rbtnet.com:8085;
proxy_read_timeout 60s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'Upgrade';
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
server {
listen 443 ssl;
server_name rbtnet.com;
charset utf-8;
client_max_body_size 50m;
ssl_certificate /cert/www.rbtnet.com.pem;
ssl_certificate_key /cert/www.rbtnet.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_prefer_server_ciphers on;
location /blog {
alias /blog;
}
location / {
proxy_pass http://www.rbtnet.com:8080;
proxy_set_header x-forwarded-for $remote_addr;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
}
location /websocket {
proxy_pass http://www.rbtnet.com:8085;
proxy_read_timeout 60s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'Upgrade';
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
}