Skip to content

Commit

Permalink
Move users-api proxy to nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
henrist committed Jun 26, 2024
1 parent e6418e9 commit 2261f58
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
15 changes: 15 additions & 0 deletions ansible/roles/service-nginx-front-1/files/foreningenbs.conf
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,21 @@ server {
proxy_pass $upstream;
}

location ~ ^/users-api/ {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;

proxy_redirect off;

# Setting a variable to defer resolving.
set $upstream http://users-api.zt.foreningenbs.no:8000;
proxy_pass $upstream;
}

location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $host;
Expand Down
3 changes: 0 additions & 3 deletions ansible/roles/service-web-1/templates/foreningenbs.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
Alias /smaabruket /var/www/aliases/smaabruket/public
RewriteRule /smaabruket-test /confluence/pages/viewpage.action?pageId=2031684 [PT,L]

# Brukersystemet.
ProxyPass /users-api http://users-api.zt.foreningenbs.no:8000

# Statutter.
Alias /statutter/arkiv /var/www/statutter-arkiv/arkiv
RewriteRule ^/statutter/?$ https://foreningenbs.no/confluence/display/statutter [R,L]
Expand Down

0 comments on commit 2261f58

Please sign in to comment.