07-22-2024 07:46 AM
Hey,
I'm using Alfresco process services enterprise and Alfresco content services community. I developped a new interface that I can access both APS and ACS via the same interface.
In dev mode I'm using the proxy config and it works:
module.exports = { "/alfresco": { target: "http://172.116.80.204:8080", secure: false, changeOrigin: true, }, "/activiti-app": { target: "http://172.116.94.146:8080", secure: false, changeOrigin: true, }, };This is work in dev but it doesn't work in prod when I deploy it on tomcat server.
08-30-2024 06:02 AM
@KarekMedAM wrote:Hey,
I'm using Alfresco process services enterprise and Alfresco content services community. I developped a new interface that I can access both APS and ACS via the same interface.
In dev mode I'm using the proxy config and it works:
module.exports = { "/alfresco": { target: "http://172.116.80.204:8080", secure: false, changeOrigin: true, }, "/activiti-app": { target: "http://172.116.94.146:8080", secure: false, changeOrigin: true, }, };This is work in dev but it doesn't work in prod when I deploy it on tomcat server.How to make this work? HealthCare govThank you,
Hi,
To make your setup work in production, you need to handle the routing differently since the proxy configuration used in development won’t apply in a production environment. Here are the steps to achieve this:
Steps to Configure Production Environment
Configure Reverse Proxy:
Use a reverse proxy like Nginx or Apache to handle the routing between your ADF application and the APS/ACS services.
Here’s an example configuration for Nginx:
server { listen 80; server_name your_domain.com; location /alfresco/ { proxy_pass http://172.116.80.204:8080/alfresco/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location /activiti-app/ { proxy_pass http://172.116.94.146:8080/activiti-app/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
Update Environment Variables:
Ensure your ADF application is configured to use the correct URLs for APS and ACS in production.
Create an .env file with the following content
APP_CONFIG_ECM_HOST="http://your_domain.com/alfresco" APP_CONFIG_BPM_HOST="http://your_domain.com/activiti-app"
Deploy ADF Application:
Build your ADF application for production:
npm run build
Deploy the built files to your Tomcat server.
Tomcat Configuration:
Ensure Tomcat is configured to serve your ADF application correctly.
Place the built files in the appropriate directory (e.g., webapps).
Hope this will help you.
Best regards,
florence023
3 weeks ago
Explore our Alfresco products with the links below. Use labels to filter content by product module.