Skip to content

Commit

Permalink
Add new nginx config
Browse files Browse the repository at this point in the history
  • Loading branch information
sakshamsharma committed Feb 7, 2017
1 parent 7ea2f9f commit f1f2976
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 26 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ sudo cp puppy.nginx.conf /etc/nginx/sites_enabled/

Edit /etc/hosts file
```
# Map puppy.pclub.in to 127.0.0.1
# Map dev.puppy.pclub.in to 127.0.0.1
# It should have a line saying:
# 127.0.0.1 <something> <more> puppy.pclub.in
# Remove this entry when you want to access the actual puppy-love (deployed by pclub)
# 127.0.0.1 <something> <more> dev.puppy.pclub.in
```

Get the essential dockers
Expand Down Expand Up @@ -153,13 +152,13 @@ http get 'localhost:3000/compute/prepare' $CADMIN
```

### Using the frontend
Once you've created the users, you will need to register them. Open the UI at puppy.pclub.in, and go to signup. You can only register for users which you have created. Get your auth token via email, and then fill up the remaining fields.
Once you've created the users, you will need to register them. Open the UI at dev.puppy.pclub.in, and go to signup. You can only register for users which you have created. Get your auth token via email, and then fill up the remaining fields.

### Notes
* You cannot login as admin on the frontend UI.
* You can also check mongoDB's data for the auth token for the user.

You can open the local website at [puppy.pclub.in](puppy.pclub.in)
You can open the local website at [dev.puppy.pclub.in](dev.puppy.pclub.in)
The backend will be listening on the printed port number.

**Note**: Course project for CS252, by [Saksham Sharma](https://github.com/sakshamsharma/) and [Vinayak Tantia](https://github.com/vtantia).
Expand Down
50 changes: 29 additions & 21 deletions puppy.nginx.conf
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
server {
listen 80;
server_name puppy.pclub.in;
listen 80;
server_name dev.puppy.pclub.in;

location /api/ {
proxy_pass http://127.0.0.1:3000/;
proxy_set_header Connection '';
proxy_set_header Host 'puppy.pclub.in';
add_header 'Access-Control-Allow-Origin' $host;
proxy_http_version 1.1;
proxy_cookie_domain .pclub.in puppy.pclub.in;
chunked_transfer_encoding off;
proxy_connect_timeout 5m;
proxy_read_timeout 5m;
}
location /api {
# proxy_pass http://pclub.cse.iitk.ac.in;
proxy_pass http://localhost:3000;
proxy_set_header Connection '';
proxy_set_header Host 'pclub.cse.iitk.ac.in';
proxy_set_header Referrer 'pclub.cse.iitk.ac.in';
add_header 'Access-Control-Allow-Origin' $host;
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_connect_timeout 5m;
proxy_read_timeout 5m;
}

location /Oa {
proxy_pass http://oa.cc.iitk.ac.in:80;
proxy_set_header Connection '';
add_header 'Access-Control-Allow-Origin' $host;
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_connect_timeout 5m;
proxy_read_timeout 5m;
}

location / {
proxy_pass http://localhost:8091/;
proxy_http_version 1.1;
proxy_read_timeout 86400;
add_header 'Access-Control-Allow-Origin' 'puppy.pclub.in';

# try_files $uri $uri/ =404;
}
location / {
proxy_pass http://localhost:8091/;
proxy_http_version 1.1;
proxy_read_timeout 86400;
proxy_set_header Host 'pclub.cse.iitk.ac.in';
}
}

0 comments on commit f1f2976

Please sign in to comment.