Skip to content

Instantly share code, notes, and snippets.

@ManikantThakur
Forked from micho/nginx.conf
Created May 15, 2017 11:32
Show Gist options
  • Save ManikantThakur/b2fc8e26b5a0e077934b0bca7c2053b0 to your computer and use it in GitHub Desktop.
Save ManikantThakur/b2fc8e26b5a0e077934b0bca7c2053b0 to your computer and use it in GitHub Desktop.

Revisions

  1. @micho micho revised this gist Oct 2, 2014. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,10 @@ First, install nginx for mac with "brew install nginx".

    Then follow homebrew's instructions to know where the config file is.

    To use https you will need a self-signed certificate.
    1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self
    2. Copy it somewhere (use full path in the example below for server.* files)
    3. sudo nginx -s reload
    4. Access https://localhost/

    Edit /usr/local/etc/nginx/nginx.conf:

  2. Pablo Villalba revised this gist Jul 22, 2012. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,8 @@ Then follow homebrew's instructions to know where the config file is.

    To use https you will need a self-signed certificate.

    Edit /usr/local/etc/nginx/nginx.conf:

    --------------------


  3. Pablo Villalba revised this gist Jan 31, 2012. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,12 @@
    First, install nginx for mac with "brew install nginx".

    Then follow homebrew's instructions to know where the config file is.

    To use https you will need a self-signed certificate.

    --------------------


    #user nobody;
    worker_processes 1;

  4. @unixcharles unixcharles created this gist Apr 30, 2011.
    64 changes: 64 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,64 @@
    #user nobody;
    worker_processes 1;

    events {
    worker_connections 1024;
    }


    http {
    include mime.types;
    default_type application/octet-stream;
    send_timeout 1800;
    sendfile on;
    keepalive_timeout 6500;

    server {
    listen 80;
    server_name localhost;

    location / {
    proxy_pass http://localhost:3000;
    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_set_header X-Client-Verify SUCCESS;
    proxy_set_header X-Client-DN $ssl_client_s_dn;
    proxy_set_header X-SSL-Subject $ssl_client_s_dn;
    proxy_set_header X-SSL-Issuer $ssl_client_i_dn;
    proxy_read_timeout 1800;
    proxy_connect_timeout 1800;
    }
    }

    # HTTPS server

    server {
    listen 443;
    server_name localhost;

    ssl on;
    ssl_certificate server.crt;
    ssl_certificate_key server.key;

    ssl_session_timeout 5m;

    ssl_protocols SSLv2 SSLv3 TLSv1;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers on;

    location / {
    proxy_pass http://localhost:3000;
    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_set_header X-Client-Verify SUCCESS;
    proxy_set_header X-Client-DN $ssl_client_s_dn;
    proxy_set_header X-SSL-Subject $ssl_client_s_dn;
    proxy_set_header X-SSL-Issuer $ssl_client_i_dn;
    proxy_read_timeout 1800;
    proxy_connect_timeout 1800;
    }
    }

    }