incubator-answer icon indicating copy to clipboard operation
incubator-answer copied to clipboard

base url config

Open 2yearsmanong opened this issue 1 year ago • 9 comments

I want to differentiate multiple answer communities through nginx by using a domain name and URL

To Reproduce

Steps to reproduce the behavior: I changed the REACT.APP_BASE.URL through the. env.production under the UI package, but after the modification, it kept redirecting 50x.

Expected behavior

1720094447933

69d8781f-371a-41f3-8746-1da45259d82f

17608a23-c842-4f82-8d0a-aea1751a9ad8

f936ba61-c060-453b-a600-f41fae17cae0

Screenshots

May I ask the author, what else do I need to configure a secondary domain name,Thank you

Platform

  • Device: [Desktop]
  • OS: [windows]
  • Browser and version: [Chrome]
  • Version: [e.g. v1.3.5]

2yearsmanong avatar Jul 04 '24 12:07 2yearsmanong

You can refer to this document: https://answer.apache.org/docs/deploy-subdirectory.

If you still have problems after trying it, you can continue to give feedback.

shuashuai avatar Jul 05 '24 01:07 shuashuai

Run the command Initialize the project, note that you need to add your base_url (http://localhost:80/{base_url}/install/) to the access path here to see if the configuration is successful.INSTALL_PORT=80 . /answer init -C . /answer-data/.Is there a tutorial on how to add it to the access path when I initialize the third step? INSTALL_PORT=9080 REACT_APP_BASE_URL_PATH=/foo ./answer init -C ./answer-data/?thank you

2yearsmanong avatar Jul 05 '24 02:07 2yearsmanong

You can look at it in conjunction with this document: https://answer.apache.org/docs/installation.

Normally, after the initialization command completes, the access address should be localhost:80/install, but if you change the value of base_url, the access address should be http://localhost:80/base_url/install, all you need to do here is manually splice in the access address, the actual configuration should be done here

shuashuai avatar Jul 05 '24 02:07 shuashuai

If my base_URL is/foo, what command should I use to initialize it?

2yearsmanong avatar Jul 05 '24 02:07 2yearsmanong

INSTALL_PORT=80 . /answer init -C . /answer-data/

shuashuai avatar Jul 05 '24 02:07 shuashuai

Don't you need to add base_URL here? Can I access it directly through localhost/foo/install after initialization?

2yearsmanong avatar Jul 05 '24 02:07 2yearsmanong

Don't you need to add base_URL here?

No, it's just a startup command. base_url is for injecting paths when building static resources in the front end.

Can I access it directly through localhost/foo/install after initialization?

Yes!

shuashuai avatar Jul 05 '24 03:07 shuashuai

There was an issue with the reverse proxy Problem:no data 1720363681463 Nginx 1720364479600 Info 1720363973870 code config code May I ask what the problem is and if there are any further modifications needed.Thank you

2yearsmanong avatar Jul 07 '24 15:07 2yearsmanong

From your Nginx configuration, you don't have proxy api related configuration, so api_url should be ingested as default, you can also look at the network request from the console, and then manually remove the api_url prefix to manually request for testing.

shuashuai avatar Jul 08 '24 01:07 shuashuai

same issue here

C4T4 avatar Dec 15 '24 20:12 C4T4