If you are still looking for a solution, your nginx configuration should look like this in order to achieve what you described…
server {
listen 80;
server_name yourdomain.com
root /path/to/yourdomain.com;
index index.php index.html;
location / {
# directives to handle static site
}
location /sub {
# directives to handle WordPress
try_files $uri $uri/ /sub/index.php?$args;
}
location ~* \.php$ {
# pass to Apache backend
}
}
Related Posts:
- Moving to directory creates path problems.. how to solve?
- Moving from subdirectory and subdomain -> root
- How to completely remove Python from a Windows machine?
- Homebrew install specific version of formula?
- How to install MinGW 64 on windows 10
- Conda version pip install -r requirements.txt –target ./lib
- Conda version pip install -r requirements.txt –target ./lib
- [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
- How can I use an .htaccess file in Nginx?
- PackagesNotFoundError: The following packages are not available from current channels:
- Xampp MySQL not starting – “Attempting to start MySQL service…”
- Conda version pip install -r requirements.txt –target ./lib
- How can I create an MSI setup?
- Android Fastboot devices not returning device
- extconf failed, exit code 1 error when installing [Ruby on Rails] 5 on OS X Yosemite 10.10.5
- How can I convert my Java program to an .exe file?
- Initialization Script for “Standard” Aspects of a WordPress Website?
- Prompted for FTP details even with FS_DIRECT set to true
- WordPress redirecting connections on port 8080 to 80
- Optimize apache for WP use
- Populate content on install
- Changing the wp db prefix after installation?
- Automatically enable custom theme, plugins and default content on installation?
- Are there any downsides to installing WordPress on Windows versus Linux?
- Create a custom WP install with plugins, theme etc already installed?
- Installation problems on a domain-name-less server
- Things to take care when moving from hosted wordpress to self-hosting
- the correct order of manual install WP and SSL on server
- Install and configure WordPress while old site is still active
- How do I install two versions of WordPress on 1 server?
- Permalink Issues by Installing WordPress in Subdirectory / Subfolder
- Using WordPress with Apache behind an nginx reverse proxy
- NGinx + WordPress Subdomain Multi with core in Subdirectory
- How do I setup a WordPress site on a server before the domain is ready?
- How to Check the Directory Where WordPress is Installed?
- WordPress in sub directory wp-admin problem
- wp core install database connection error
- After moving wordpress some files still point to old directory
- URL to download latest version of WP for other languages than English
- Steps to debug on a blank screened wordpress install
- 404 error on homepage when using Nginx proxying to Apache
- Custom WordPress Installation
- Shortest possible shell script to install WordPress on Nginx server?
- Installed successfully; home page still redirects to install.php
- Repeatable configuration package
- One WordPress install serving multiple virtual hosts
- How to import WP XML file automatically on installation?
- WordPress within a subdirectory of another WordPress environment doesn’t work
- Moving WordPress from live to local server
- Trying to install WordPress on WSL Windows 10, and running into issues with wp-cli and “wp db create”
- Cannot access WordPress install on subdirectory of drupal site
- Sub-domain or 2nd, temporary different domain?
- WordPress redirect loop on nginx + apache reverse proxy
- Is it possible to install WordPress within WordPress installation?
- WordPress package configuration in Ubuntu Server?
- Programatically Creating Initial WordPress Site
- Can WordPress be installed at the root level, if a homepage called index.php already exists?
- Install wordpress in backend with Existing html website alive
- Moving to a new domain in the same server
- WordPress Installation for multi-domains with nginx and php-fpm
- How would you detect if WordPress is installed in a subdirectory (not root)?
- When WordPress Does Not Provide an .htaccess File for New Multisite Sites because of CPanel Fantastico Auto-Installer?
- Cant get wordpress to work on subdirectory
- Is there any plugin hook that I can latch onto once a site is freshly installed?
- No configuration file found and no installation code available. Exiting
- Change multi-site installation from sub-domains to sub-directories
- Giving WordPress its own subdirectory – nginx
- Subdirectory multisite installation with several domain names?
- WordPress multisite subdirectory on nginx behind reverse proxy
- InfiniteWP installation fails – CONFIGURABLE MAX EXECUTION TIME DISABLED
- Multiple sites/domains on one database
- Is it good security advice to install wordpress in subdirectory but link to root?
- Quickest Way Besides FTP to Upload WordPress Files to a Web Server?
- Unable to install wordpress theme without ftp user & password
- Sharing one WordPress installation between several “sites”?
- Backup blog posts only
- How to use if condition to change $table_prefix in wp_config.php
- Reinstall WordPress from zero
- How to run a subdirectory multisite install under a subdomain
- Importing wordpress. xml file on new installation
- WordPress installation does not get completed in WAMP server
- Is there any way to allow a plugin to write over a previous version?
- Novice WordPress Installation issues
- Can my site use two different WordPress installs for different pages?
- Can I clone WP to another directory on the same server?
- Can I install a new WordPress site inside a sub-directory of an existing WordPress site?
- How to download WordPress 4.2.0
- Should I delete automatically-created files before installing WordPress?
- wp theme.. Could not create directory
- W3 Total Cache – Converting Apache rewrites to Nginx [closed]
- Plugins try to install in old location [closed]
- How to work locally on a copy of my wordpress?
- Restrict uploaded files into a custom folder to logged in users by htaccess: looking for Nginx – not only Apache – solution
- When I try to install VersionPress, it tells me, “The package could not be installed. No valid plugins were found.”
- WP install in sub-dir white screen
- You appear to have already installed WordPress. To reinstall please clear your old database tables first
- Change WordPress directory
- Reset generated wp-config.php with wp-cli
- Missing wp-load.php on new install
- Automate specific steps on WordPress install