location ^~ /repetier { rewrite ^/repetier/(.*) /$1 break; sub_filter_types text/html application/javascript text/css; sub_filter '<head>' '<head><base href="/repetier/" />'; sub_filter 'href="/' 'href="/repetier/'; sub_filter 'href="../css/' 'href="/repetier/css/'; sub_filter 'src="/js/' 'src="/repetier/js/'; sub_filter 'src="/img/' 'src="/repetier/img/'; sub_filter 'window.location.host+"/socket/' 'window.location.host+"/repetier/socket/'; sub_filter 'url(\'/' 'url(\'/repetier/'; sub_filter 'url(\'../' 'url(\'/repetier/'; sub_filter 'url("/' 'url("/repetier/'; sub_filter 'url("../' 'url("/repetier/'; sub_filter_once off; proxy_pass http://SERVER_IP_ADDRESS:3344; proxy_set_header Host $host; proxy_set_header Accept-Encoding ""; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_http_version 1.1; proxy_buffering off; }
azymux said: I'm certainly not saying this is the right way to do this, but I finally got it to work with the following nginx configuration:location ^~ /repetier { rewrite ^/repetier/(.*) /$1 break; sub_filter_types text/html application/javascript text/css; sub_filter '<head>' '<head><base href="/repetier/" />'; sub_filter 'href="/' 'href="/repetier/'; sub_filter 'href="../css/' 'href="/repetier/css/'; sub_filter 'src="/js/' 'src="/repetier/js/'; sub_filter 'src="/img/' 'src="/repetier/img/'; sub_filter 'window.location.host+"/socket/' 'window.location.host+"/repetier/socket/'; sub_filter 'url(\'/' 'url(\'/repetier/'; sub_filter 'url(\'../' 'url(\'/repetier/'; sub_filter 'url("/' 'url("/repetier/'; sub_filter 'url("../' 'url("/repetier/'; sub_filter_once off; proxy_pass http://SERVER_IP_ADDRESS:3344; proxy_set_header Host $host; proxy_set_header Accept-Encoding ""; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_http_version 1.1; proxy_buffering off; }
Comments
javascript obfuscator