Last active
August 29, 2015 14:19
-
-
Save zekus/2154b1859242c3295921 to your computer and use it in GitHub Desktop.
local nginx development for ssl
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
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