Jorge Pereira
November 07, 2018 05:48PM

1. I have tried to use the map+subfilter as the below snip.

user nginx;
worker_processes auto;

daemon off;

events {
worker_connections 1024;

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'(Cache $upstream_cache_status)';

access_log /dev/stdout main;

sendfile on;
keepalive_timeout 65;
gzip on;

# Due to we are listening only http, therefore be sure to always
return http://
map $request_uri $subfilter_allowed_content_type {
default whatever/donothing;
~/artifactory/api/nuget/.* application/atom+xml;

proxy_cache_path /var/cache/nginx/artifactory

server {
listen 80;
server_name ~(?<repo>.+)\.artifactory.tapioca.lan;


set $upstream;

location /artifactory/ {
sub_filter_types $subfilter_allowed_content_type; # the
variable is filled up correctly
#sub_filter_types "application/atom+xml"; # but, when
use it hardcode. then it works fine.

sub_filter_last_modified on;
sub_filter "https://$host" http://$host"; # it works
only when use sub_filter_types with hardcore value.
sub_filter_once off;

# its been filled correctly
add_header X-Debug-subfilter-allowed-content-type

proxy_read_timeout 60s;
proxy_pass_header Server;
proxy_cookie_path ~*^/.* /;

if ( $request_uri ~ ^/artifactory/(.*)$ ) {
proxy_pass $upstream/$1;

proxy_pass $upstream;

proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Artifactory-Override-Base-Url
proxy_set_header X-JFrog-Art-Api $artifactory_token;

2. I do the request like.

curl -s -H "Host: artifactory-proxy.mylan.fni" "'AttributeRouting.Core.Web

Conclusion: the variable it been filled up correctly, but the
sub_filter_types looks to not process. Someone has any suggestion?

ps: I am using the nginx 1.12.x

Jorge Pereira
nginx mailing list
Subject Author Posted

Problems with map + subfilter + proxy

Jorge Pereira November 07, 2018 05:48PM

Re: Problems with map + subfilter + proxy

Francis Daly November 07, 2018 08:12PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 117
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready