Skip to content

Commit c751e37

Browse files
authored
Merge pull request #11 from sdtechdev/feature/configure-mobile-api-redirects
Extract mobile api paths regex into variable
2 parents 7f3b8c4 + d0f9753 commit c751e37

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

templates/default/appserver.nginx.conf.erb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ server {
2929
<%= @out[:extra_config] %>
3030
}
3131

32+
<% regex = node.read('nginx_custom', 'mobile_api_paths_regex') %>
3233
<% (node.read('nginx_custom', 'mobile_app_additional_hostnames') || []).each do |name| %>
34+
<% next if regex.blank? %>
35+
3336
server {
3437
server_name <%= name %>;
3538

3639
include /srv/www/jiffyshirts/current/config/nginx/server_common.conf;
3740

3841
# allow to process mobile app requests if they made to additional domain
39-
location ~ ^/api/orders/\d+/(current_apple_pay_payload|update_apple_pay_address)$ {
42+
location ~ <%= regex %> {
4043
proxy_pass http://unicorn_jiffyshirts;
4144
}
4245

0 commit comments

Comments
 (0)