Skip to content

Instantly share code, notes, and snippets.

@zekus
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zekus/2154b1859242c3295921 to your computer and use it in GitHub Desktop.
Save zekus/2154b1859242c3295921 to your computer and use it in GitHub Desktop.
local nginx development for ssl
daemon off;
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
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 logs/access.log main;
sendfile on;
keepalive_timeout 65;
# HTTPS server
#
server {
listen 443 ssl;
server_name <localdev>.dev;
root /local/rails/path/public;
index index.html index.htm;
ssl_certificate <localdev>.dev.crt;
ssl_certificate_key <localdev>.dev.key;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
proxy_pass http://<localdev>.dev;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
proxy_set_header X-Forwarded-Proto https;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment