Skip to content

Instantly share code, notes, and snippets.

@colinbes
Last active March 3, 2021 22:20
Show Gist options
  • Save colinbes/ae0af0f055b78c9f20fe072ee7849928 to your computer and use it in GitHub Desktop.
Save colinbes/ae0af0f055b78c9f20fe072ee7849928 to your computer and use it in GitHub Desktop.
Basic nginx configuration file.
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
include 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;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 60m;
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 logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6"
gzip_types text/plain application/xml application/javascript text/css text/javascript application/json;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
##
# Logging Settings
##
server {
listen 80;
listen [::]:80;
charset utf8;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
server_name localhost;
location / {
proxy_pass http://akka-server:8082; //note use of akka-server for hostname (services name for akka)
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Connection ''; //NB for CORS
proxy_http_version 1.1; //NB for CORS
chunked_transfer_encoding off; //NB for CORS
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 700;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
}
access_log /var/log/nginx/access.log main;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment