I guess it's a very basic question, but it still confuses me. At development stage, when launching react with 'npm start' I'm using port 3000. In addition when launching strapi (which is a backend cms), it automatically uses port 1337.
Does it actually mean that my app is using two different ports?
I'm asking this because I would like to configure nginx so that I can run two different strapi apps (attached to two different react apps) - on the same server.
I want nginx to redirect from a specific location to the second website. I could write inside the sites-available file:
server {
listen 80;
location / {
proxy_pass "http://mysite:3000";
}
location /mysecondsite {
rewrite ^/mysecondsite(.*) $1 break;
proxy pass "http://mysite:??????? WHAT SHOULD I WRITE HERE?"
}
}
But where should I redirect users entering the secondsite url, to what port?
In strapi documentation, they point to a file called server.json where you can change the port that strapi uses, and also create a proxy (which I don't understand why you would want to do if you can just redirect from nginx?), for example:
{
"host": "localhost",
"port": 1337,
"proxy": {
"enabled": true,
"ssl": true,
"host": "example.com",
"port": 8443
},
"autoReload": {
"enabled": true
},
"cron": {
"enabled": true
}
}
But changing the port of the second project will affect only the strapi backend, won't it? How can I create a different port for the front end of the second project?
I'm sorry if I misunderstand the terms here Thanks in advance