Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save osharim/8263714 to your computer and use it in GitHub Desktop.

Select an option

Save osharim/8263714 to your computer and use it in GitHub Desktop.

Revisions

  1. osharim revised this gist Jul 24, 2019. No changes.
  2. osharim revised this gist Jun 18, 2019. No changes.
  3. osharim renamed this gist Jun 18, 2019. 1 changed file with 0 additions and 0 deletions.
  4. osharim revised this gist Sep 14, 2017. No changes.
  5. @Omarhernandez Omarhernandez renamed this gist Jan 5, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. @Omarhernandez Omarhernandez created this gist Jan 5, 2014.
    43 changes: 43 additions & 0 deletions my_site
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    #Django Config

    server {
    server_name domain.com;


    access_log on;

    location / {
    proxy_pass http://127.0.0.1:8001;
    proxy_set_header X-Forwarded-Host $server_name;
    proxy_set_header X-Real-IP $remote_addr;
    add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
    }
    }


    #Nodejs Config

    server{

    server_name subdomain.domain.com;
    access_log /var/log/nginx/me.log;
    location / {


    proxy_pass http://127.0.0.1:8002;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;

    #IMPORTANT
    #Must allow access to this origin resource http://subdomain.domain.com;
    #if is not set , you will get CORS message and the websockets will be blocked
    proxy_set_header Access-Control-Allow-Origin http://subdomain.domain.com;
    proxy_set_header 'Access-Control-Allow-Headers' 'X-Requested-With,Accept,Content-Type, Origin';
    proxy_set_header X-NginX-Proxy true;


    proxy_redirect off;
    }
    }