First, you shouldn’t use root
directive inside the location block, it is a bad practice. In this case it doesn’t matter though.
Try adding a second location block:
location ~ /some/path/(?<section>.+)/index.html {
proxy_pass http://192.168.1.24/$section/index.html;
proxy_set_header Host $host;
}
This captures the part after /some/path/ and before index.html to a $section variable, which is then used to set the proxy_pass destination. You can make the regex more specific if you require.
Related Posts:
- How to use NGINX as forward proxy for any requested location?
- 302 redirect to signup with nginx reverse proxy
- WordPress multisite subdirectory on nginx behind reverse proxy
- Infinite loop behind SSL proxy on non-standard port
- Nginx + Redirection Plugin breaks Permalinks [closed]
- In Nginx, how can I rewrite all http requests to https while maintaining sub-domain?
- How to force or redirect to SSL in nginx?
- Nginx redirect one path to another
- Remove “www” and redirect to “https” with nginx
- How can I use environment variables in Nginx.conf
- Nginx: Failed to start A high performance web server and a reverse proxy server
- NGINX: upstream timed out (110: Connection timed out) while reading response header from upstream
- “configuration file /etc/nginx/nginx.conf test failed”: How do I know why this happened?
- Forwarding port 80 to 8080 using NGINX
- nginx – two subdomain configuration
- GeoIP.dat.gz and GeoLiteCity.dat.gz not longer available? Getting 404 trying to load it
- WordPress redirecting connections on port 8080 to 80
- How to configure nginx to redirect requests to the uploads directory to the production server?
- WordPress behind Proxy – Mixed Content
- How to setup 301 redirects for multiple query string URLs?
- WordPress redirect loop on nginx + apache reverse proxy
- Mixed Content with SSL, wordpress behind a reverse proxy
- NGINX conf on WP Multisite enabled — subdirectory — images fail to load after updates
- Configuring Routing Rules for WordPress+Nginx and WP-SuperCache?
- Installation failed: Could not create directory – CentOS 7
- REST API parameters not working with nginx
- Difference between these two nginx try_files statements for WordPress?
- How to test drive WordPress on VPS with LEMP stack before going live?
- nginx.conf appeared in all WordPress installations on folder
- nginx php-fpm, and auto updates?
- nginx wordpress subdirectory Invalid post type
- wp-login behind nginx reverse-proxy inaccessible — bad redirect?
- ERROR: No such service: nginx when building wordpress with docker [closed]
- Nginx tries the wrong file when http_cookie matches logged_in
- Site resolves to www in Firefox and without in Chrome
- I get redirected too many times only in wp-admin?
- WordPress Nginx Won’t 404
- WordPress file not found and 403 forbidden
- Nginx config, how can I redirect primary multisite domain, but not its sub-folders, nor other domains?
- Correct regex for Nginx FastCGI cache?
- Random occurences of 502 Bad Gateway using WordPress and Nginx
- SSL via different domain & path with NGINX/PHP-FPM/WP
- Limit file downloads to logged in users (WP + Nginx)
- Blog has an infinite redirect loop
- /blog/wp-json/ nginx return 404
- WordPress with Photocrati Theme keeps resetting site URL – help solving underlying problem
- Moving wordpress to different url/server creates redirect loop
- NGINX / WordPress Site – Increasing php.ini max_execution_time = 600 doesn’t work
- How does WordPress format the url on a 301 when a trailing slash is missing?
- Nginx redirects to an extra subdirectory
- Something is injecting a slash after any static file response , server is nginx
- Custom permalinks not work on Nginx + Apache
- Can’t login to WordPress admin panel after changing domain to use WordPress pages as a fallback from React
- Last-Modified header is removed from server response!
- htaccess redirect not working for wp-admin/edit in site using proxy
- WordPress on Ubuntu – “File not Found” for home.php – Trying to Redirect to Root Folder
- How to make wordpress page site.com/content as location for main site.com that is worked on nuxt.js+node?
- 504 Gateway Time-out nginx/1.14.0 (Ubuntu)
- Redirect old /%category%/%postname%/ to just /%postname%/
- 301 Redirect Loop www to non-www – Nginx + Apache2
- WordPress + Nginx (Lightsail) problem with ajax
- Multisite wp-admin redirecting to main wp-admin using NGINX
- Restrict access if logged out except for homepage
- Local domain remap with proxy : Infinite 301 redirect, bad URL typo
- I have cloudflare flexible enabled, How to redirect to https for Nginx server
- Can I do fragment caching with NGINX fastcgi?
- Redirecting a POST to a php script
- How to block direct access to files upload in edd folder
- Proxy caching WordPress with Nginx
- Nginx Multisite redirects (incorrectly) on Chrome IE and Mobile, but works (correctly) on Firefox
- How to configure nginx for wordpress
- Rewrite old post images to https
- Varnish + Nginx for WordPress is Good?
- Access denied unless I add trailing /
- WordPress stuck at Step 1 of setup behind nginx reverse proxy
- Why do I need Nginx and something like Gunicorn?
- Nginx reverse proxy + URL rewrite
- How do I add Access-Control-Allow-Origin in NGINX?
- nginx HTTPS serving with same config as HTTP
- Nginx config reload without downtime
- How do you restart php-fpm?
- How to set up Nginx as a caching reverse proxy?
- How to output variable in nginx log for debugging
- Make nginx to pass hostname of the upstream when reverseproxying
- connect() failed (111: Connection refused) while connecting to upstream
- Nginx 1 FastCGI sent in stderr: “Primary script unknown”
- Nginx: How do I forward an HTTP request to another port?
- Setting expires headers for static content served from nginx
- How to restart nginx?
- What does this nginx error “rewrite or internal redirection cycle” mean?
- How does try_files work?
- nginx – client request body is buffered to a temporary file
- Do you need separate IPv4 and IPv6 listen directives in nginx?
- an upstream response is buffered to a temporary file
- Disable caching when serving static files with Nginx (for development)
- How to make a modification take affect without restarting nginx?
- How to use nested Nginx location blocks (prefixes vs. regex directives)?
- Nginx – root versus alias, for serving single files?
- Why do I need nginx when I have uWSGI
- Loading WordPress Site Inside iframe won’t allow users to login