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
- Conda version pip install -r requirements.txt –target ./lib
- extconf failed, exit code 1 error when installing [Ruby on Rails] 5 on OS X Yosemite 10.10.5
- Initialization Script for “Standard” Aspects of a WordPress Website?
- Populate content on install
- Are there any downsides to installing WordPress on Windows versus Linux?
- Install and configure WordPress while old site is still active
- NGinx + WordPress Subdomain Multi with core in Subdirectory
- How to Check the Directory Where WordPress is Installed?
- WordPress in sub directory wp-admin problem
- After moving wordpress some files still point to old directory
- URL to download latest version of WP for other languages than English
- Custom WordPress Installation
- Shortest possible shell script to install WordPress on Nginx server?
- Repeatable configuration package
- WordPress within a subdirectory of another WordPress environment doesn’t work
- WordPress redirect loop on nginx + apache reverse proxy
- Is it possible to install WordPress within WordPress installation?
- Can WordPress be installed at the root level, if a homepage called index.php already exists?
- No configuration file found and no installation code available. Exiting
- Change multi-site installation from sub-domains to sub-directories
- 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?
- Sharing one WordPress installation between several “sites”?
- Backup blog posts only
- Reinstall WordPress from zero
- Importing wordpress. xml file on new installation
- Is there any way to allow a plugin to write over a previous version?
- Can my site use two different WordPress installs for different pages?
- Can I clone WP to another directory on the same server?
- How to download WordPress 4.2.0
- W3 Total Cache – Converting Apache rewrites to Nginx [closed]
- How to work locally on a copy of my wordpress?
- When I try to install VersionPress, it tells me, “The package could not be installed. No valid plugins were found.”
- Missing wp-load.php on new install
- Use new domain name on previously installed files of wordpress
- WordPress installed in root, need second in subdirectory with different domain
- Correct folder permissions?
- subdirectory install breaking existing links
- Installing wordpress on Parallels plesk 9.5.3
- Multi site clarification
- WordPress (behind HAProxy and Jetty), not multisite, in sub folder – and /en/wp-admin/ keeps redirecting to /wp-admin/
- wp-login behind nginx reverse-proxy inaccessible — bad redirect?
- Install WordPress with custom directory layout without breakting media upload
- wp-cli fails on installing to subdomain
- How to edit an existing wordpress.org site
- Installing WordPress in a subdirectory
- how to return the wordpress path to the new site
- Version 3.04 or 3.5?
- Recommendation for server config for WordPress Staging servers [closed]
- Basic installation questions
- Creating a copy of a website in a subdirectory, wp-admin redirect problem
- Moving wordpress to different url/server creates redirect loop
- WSOD right after install
- Access sub-domain when root public_html is protected with .htaccess password
- How to install WP alongside my existing site at a sub-directory (bradydjohnson.com/blog)?
- What are the pros & cons of a new wordpress installation vs fixing one that already exists?
- Installing WAMP and WordPress: Visual Studio 2013 or 2012? [closed]
- I moved my WordPress site to the main directory and now I can’t access my admin
- Does WordPress refer to any files outside of the main install folder (and database)?
- WordPress Skeleton installation
- Things to take care before installing wordpress Manual v/s Softaculous
- Why is WordPress’ installer “phoning home” during the install script?
- Site blocked by WebSense on fresh WP Install
- Is it bad practice to install WordPress by cloning from the official GitHub repo?
- How to move a WordPress installation to a subdirectory
- issue with wordpress [wp-admin] redirects, when using kubernetes ingress hosting two wordpress websites using path
- Fresh installation of WordPress on CentOS produces critical error during installation
- Trying to make my home-made WordPress website visible by public network
- How to install WordPress on sub directory in ubuntu 16.4 in same vhost with AngularJS
- Delete all php files except WordPress core files?
- my client’s site is confused between WordPress.com and WordPress.org I think
- Installation failed: Destination folder already exists
- Why are the latest visits to my website originating from my own website?
- Installing WordPress to root directory with existing static site. Concerns?
- First time installing WordPress. Cant Access
- Fatal error: Class ‘Requests_Utility_CaseInsensitiveDictionary’ not Found in WordPress
- What is the “Quick and Dirty” way to transfer WordPress installation?
- Moved WordPress to other folder (Windows) WAMP = 403 Forbidden
- How to update WP-CLI on Windows via Composer?
- CPU spikes to 100% site doesn’t load, VPS crashes after moving site
- Have non-wordpress page as root (and blog elsewhere)
- Install wordpress as a development site in a subdirectory on live server
- Apache extensions for WordPress’ working without troubles
- Incorrect Blog Root
- Installing WordPress into a user directory without any admin privileges
- Doubts about how to migrate WordPress from local to online server using Search and Replace Tool script
- Is it ok to have one wordpress installation for server.com and www.server.com?
- Are two installations of WordPress on the same domain (no subdomains) ok?
- I can access to my wordpress page at work and via cellphone, but when I get home, I can’t access to the website
- Multiple independent wordpress installs – 1 dedicated server – individual dedicated domain for each install. What is the best way to achieve this?
- WordPress desktop app shows blank screen
- Correct folder & file permisson for WordPress
- Multisite Sub-directories Installation
- Could moving my WordPress installation from /var/www/html/ to /var/www/ break the application?
- Serve static files via a subdomain on a wordpress
- Backend working but not front
- Installing wordpress into the same directory as existing static html website