PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, November 13, 2022

[FIXED] How to proxy all requests to localhost using nginx and plesk?

 November 13, 2022     centos, nginx, nuxt.js, plesk     No comments   

Issue

I need to deploy a Nuxt.js SSR web application on a centos server. Plesk control panel is already on the server so I need to proxy all requests from example.com to localhost:3000 except plesk control panel which is example.com:8443 and an API URL which is example.com/api/v1 (API is in the WWW folder). The Web server used is nginx.

I tried to use nginx proxy mode, but then I can't get access to API or plesk control panel anymore.

I expect to have 3 vhosts on one IP:

  1. www.example.com for web application
  2. www.example.com:8443 for plesk control panel
  3. www.example.com/api/v1 for API

Solution

For those with the same problem. this is how i solved it: go to Plesk control panel/ websites and domain/ Apache and Nginx settings in Additional Apache directives section you can add your apache code:

<Location />
	ProxyPass http://localhost:3000/
	ProxyPassReverse http://localhost:3000/
</Location>

<Location /API/>
	ProxyPass !
</Location>



Answered By - Pouria
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,204,304

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing