On my EC2, Magento is installed on main domain with nginx and now i want to install wordpress on magento subdirectory. how can i configure nginx for wordpress? Magento website: domain.com Wordpress website: domain.com/blog


2 Answers 2

  1. Create a Directory inside Magento's Pub/Wordpres-Directory folder.
  2. Download wordpress from wordpress.org and Upload Wordpress in that Wordpres-Directory
  3. Create a database for wordpress and then install worpress by following instruction https://wordpress.org/support/article/how-to-install-wordpress/
  4. Then open wordpress by www.yourdomain.com/Wordpres-Directory
  • It works. One question, How can we execute PHP files of WordPress that are situated inside /the pub/wp folder? because we need to add every PHP file inside nginx.conf.sample file before executing it. Dec 8, 2022 at 12:16
  • Find the PHP location block (# PHP entry point for the main application) as shown in the below screenshot and add the custom PHP file in nginx.conf. location ~^/(index|get|static|errors/report|errors/404|errors/503|health_check|test).php$ If we want to allow all the custom PHP files to run then replace the above line as- location ~* .php$ { Dec 8, 2022 at 12:24
  • Thanks, it works Can you please help, wordpress shows ibb.co/WtJmSMW when i click on themes. Dec 8, 2022 at 13:21
  • Your welcome Ansh. You can provide me bounty if it works for you. I have not expertise in WP. Dec 8, 2022 at 14:29
  • @AnshBhatia if this works for you then mark this answer as useful. Dec 12, 2022 at 16:44

Try this extension:-



Installation Guide


  • Hello, Can we do this without fishpig? Dec 8, 2022 at 6:26
  • I used this extension in my past project, not sure without an extension. Dec 8, 2022 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.