User Tools

Site Tools


support:scottypro_architecture

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
support:scottypro_architecture [2018/09/03 17:54] adsilvasupport:scottypro_architecture [2021/06/25 10:09] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== ScottyPro Ticketer Environment  ======
 +
 +Author: Avi D' Silva
 +
 +The current ScottyPro Ticketer runs on an AWS instance, and it was being pointed to using an Iframe.
 +
 +This entry documents all the changes that were done to move away from the Iframe approach and use the DNS directly. This can also be referred when configuring a new instance with ScottyPro-Ticketer.
 +
 +The Ticketer instance itself runs on ":8083/Ticketer" so the first thing that needs to be done:
 +
 +**Install Nginx as a proxy** (sudo apt-get install nginx)
 +
 +You will find the configuration in /etc/nginx/conf/sites-enabled
 +
 +Now we have to configure nginx to handle the following use cases:
 +
 +<code>
 +1. Proxy traffic from Port 80 to Port 8083
 +
 +2. Forward all http://www.scottypro.com requests to http://scottypro.com
 +
 +3. Redirect all base URL requests to Ticketer App (Ex: http://scottypro.com/?tid=100 becomes http://scottypro.com/Ticketer/?tid=100)
 +
 +4. Edge case where Ticketer adds an extra slash "*.com//auth/signin"
 +
 +5. Edge case where Ticketer adds an extra slash on logout "*.com//"
 +</code>
 +
 +First we create a file "/etc/nginx/sites-enabled/www-scotty-to-non-www"
 +This will basically convert any www traffic to non-www
 +
 +<code>
 +server {
 +    server_name www.scottypro.com;
 +    return 301 $scheme://scottypro.com$request_uri;
 +}
 +</code>
 +
 +
 +Next, we create/edit the file "/etc/nginx/sites-enabled/default"
 +The rules are written to take care of rest of the above use cases.
 +
 +<code>
 +server {
 + #listen   80; ## listen for ipv4; this line is default and implied
 + #listen   [::]:80 default ipv6only=on; ## listen for ipv6
 +
 + root /usr/share/nginx/www;
 + index index.html index.htm;
 +
 + # Make site accessible from http://scottypro.com/
 + server_name scottypro.com;
 +
 + merge_slashes off;
 + rewrite ^(.*?)//+(.*?)$ $1/Ticketer/$2 permanent;
 + location /Ticketer {
 +
 +     proxy_pass http://localhost:8083/Ticketer;
 +
 + }
 +location / {
 +    rewrite ^/(.*)$ http://scottypro.com/Ticketer/$1 redirect;
 +}
 +
 +location // {
 +    rewrite ^/(.*)$ http://scottypro.com/Ticketer/$1 redirect;
 +}
 +
 +}
 +</code>
 +
 +The last thing that remains would be point the A record of scottypro.com (from godaddy.com) to point to the right IP address 
 +
 +Also, add a CNAME record for "www" to point the base "*" or "@" record. so that both www and non-www point to the same IP.