Skip to content

aisu-programming/NTNU-Course-Queuing-Website

Repository files navigation

NTNU-Course-Queuing-Website

NTNU Course Queuing Website / 師大課程排隊網站

🎞️ Video demonstration

image

image

Tutorial of network management (Reverse proxy)

I used Apache at the beginning, but it is extremely slow.

Then I tried Nginx, but it seems like containing a lot of bugs on Windows, it is not friendly...

In the end, I tried Caddy... And I found that it is super fast and easy to configure. Amazing!

  1. Apply for certificates to change HTTP to HTTPS

    1. You can use Certbot of Let's Encrypt to generate your certificates.

      There are plenty tutorials on the Internet, I list the best one for me at here only:

    2. Move the certificates that you generated by Certbot into directory Proxy.

  2. Buy a domain

    I bought one on NameCheap with about 2 USD (about 60 TWD), which is "ntnu.site".

  3. Caddy (Reverse proxy)

    1. Download Caddy.

    2. You can choose to add its path into environment variables, or put the whole directory here.

      I'm not going to explain this in detail because it is tedious and a little complicated.

      Here's a tutorial for you guys: https://wst24365888.github.io/install-caddy/

    3. Rename Caddyfile_example in directory Proxy to Caddyfile.

    4. Open it and do some changes:

      1. Change "YOUR_DOMAIN" in line 1 to your domain.

      2. Change "FULL_CHAIN.PEM" in line 3 to your full chain certificate filename. Default should be "fullchain1.pem".

      3. Change "PRIVATE_KEY.PEM" in line 3 to your private key certificate filename. Default should be "privkey1.pem".

      4. Change "BACK_END_URL" to your Back-End URL.

        Most of the people setup Back-End on the same computer with reverse proxy, then the Back-End URL should be "127.0.0.1".

      5. Do same thing to "FRONT_END_URL"

      6. Change "BACK_END_PORT" to your Back-End port. Default should be 5000.

      7. Change "FRONT_END_PORT" to your Front-End port. Default should be 3000.

    5. Run the Caddy with command caddy run or caddy start.