Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example nginx configuration #10

Closed
luclu7 opened this issue Nov 30, 2020 · 3 comments
Closed

Example nginx configuration #10

luclu7 opened this issue Nov 30, 2020 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@luclu7
Copy link

luclu7 commented Nov 30, 2020

Hi,

I'm trying to setup this app with an Nginx reverse proxy (mostly for HTTPS), I'd like to know if you have a guide on/know how to setup it that way.

Thank you for making this!

@guilhermebkel
Copy link
Owner

Hello @luclu7 😄!
Thanks for getting in touch! At first I recommend you to try it on your machine just to understand how to run this game (it can help you setting up it later on some server). Below you can see a basic setup idea:

Setup Idea

To setup this game (with nginx or another resources) you can take the generic idea:

  1. You have to build a component (front-end or back-end)
  2. You have to add the component environment variables (try not to forget adding the env variables using .env.example file that exists inside each component)
  3. You need to execute the builded component (you can use Docker or even run it directly on server)
  4. You have to expose the running component on internet (reverse proxy)

Basic Setup

Being minded about the idea above, a basic setup with nginx (supposing that a server is already setup and running) would be:

  • Back-end:
  1. Build API using npm run ci:unapy command
  2. Execute API using npm run start:unapy command
  3. Add a rule on nginx to make a proxy to api locally
server {
    listen 80;
    server_name api.somename.com;

    location / {
        proxy_pass http://localhost:4555;
    }
}
  • Front-end:
  1. Build Client using npm run ci:unoenty command
  2. Add a rule on nginx to make a proxy to client locally
server {
    listen 80;
    server_name client.somename.com;

    location / {
        index /client-folder/index.html;
    }
}

Guides

  1. HTTPS setup: https://www.digitalocean.com/community/tutorials/how-to-set-up-let-s-encrypt-with-nginx-server-blocks-on-ubuntu-16-04
  2. Nginx setup: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04
  3. Nginx for front-end: https://medium.com/@timmykko/deploying-create-react-app-with-nginx-and-ubuntu-e6fe83c5e9e7
  4. Nginx for back-end: https://www.tecmint.com/nginx-as-reverse-proxy-for-nodejs-app

In case you have some trouble setting it up, I'm totally opened to help you doing that! 🤘 Just send me some message and I will reply it asap 😁.

@guilhermebkel guilhermebkel self-assigned this Nov 30, 2020
@guilhermebkel guilhermebkel added the question Further information is requested label Nov 30, 2020
@guilhermebkel guilhermebkel pinned this issue Dec 30, 2020
@agakcw12
Copy link

image

@agakcw12
Copy link

i have this problem to build the api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants