Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritzs committed Mar 4, 2025
1 parent ecb30ad commit 7261bfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/update_primary_nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Export environment variables
run: |
export URL_PREFIX=http://
export PORT_PREFIX=2
export DEV_POSTFIX=1
export STAG_POSTFIX=2
export PROD_POSTFIX=3
export DEV_PORT_PREFIX=${PORT_PREFIX}${GROUP_ID}${DEV_POSTFIX}
export STAG_PORT_PREFIX=${PORT_PREFIX}${GROUP_ID}${STAG_POSTFIX}
export PROD_PORT_PREFIX=${PORT_PREFIX}${GROUP_ID}${PROD_POSTFIX}
- name: Replace environment variables in Nginx config
run: |
envsubst < ./nginx_template.txt > ./nginx_secfit.conf
envsubst '${DEV_PORT_PREFIX} ${PROD_PORT_PREFIX} ${STAG_PORT_PREFIX} ${GATEWAY_POSTFIX}' < nginx_secfit.conf > nginx/nginx.conf
# Test the nginx configuration
- name: Test nginx configuration file
Expand All @@ -37,7 +26,7 @@ jobs:
# Copying nginx configuration file to the server
- name: Deploy nginx configuration file
run: |
sudo cp ./nginx_secfit.conf /etc/nginx/conf.d/nginx.conf
sudo cp ./nginx/nginx.conf /etc/nginx/conf.d/nginx.conf
# Restarting nginx service
- name: Restart nginx service
Expand Down
2 changes: 1 addition & 1 deletion nginx_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ server {
server {
listen ${DEV_PORT_PREFIX}7;
location / {
proxy_pass http://0.0.0.0:${envDEV_PORT_PREFIX}${GATEWAY_POSTFIX}/;
proxy_pass http://0.0.0.0:${DEV_PORT_PREFIX}${GATEWAY_POSTFIX}/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down

0 comments on commit 7261bfb

Please sign in to comment.