Proxy root url
See original GitHub issueWhat problem does this feature solve?
devServer.proxy cannot be used to proxy root requests now. It is very usefull when your vue app is under some php project.
What does the proposed API look like?
Webpack DevServer can be set to proxy root requests too: https://webpack.js.org/configuration/dev-server/#devserverproxy with this config:
module.exports = {
//...
devServer: {
index: '', // specify to enable root proxying
host: '...',
contentBase: '...',
proxy: {
context: () => true,
target: 'http://localhost:1234'
}
}
};
but now this config throw error:
When `proxy` in package.json is an object, each `context` object must have a `target` property specified as a url string
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Proxy to sites that expect to be at root URL? - Server Fault
(Normally a proxy only rewrites HTTP headers/responses). mod_substitute in apache 2.2. I haven't tested if it stacks well with mod_proxy and ...
Read more >Behind a Proxy - FastAPI
That demonstrates how the Proxy (Traefik) uses the path prefix and how the server (Uvicorn) uses the root_path from the option --root-path ....
Read more >nginx location proxy pass forwarding to root URL rather than ...
I am using Nginx as a proxy, example.com is my outward-facing web server with SSL enabled I want traffic coming under ...
Read more >Reverse proxy redirect to servers based on url root path - Help!
I am new to HAProxy and struggling to understand how things to configure. I have found just one example for Grafana, though I...
Read more >root proxy url - Technical Documentation - Juniper Networks
Specifies your network's HTTP proxy server, which can submit HTTP requests on the E Series router's behalf to retrieve the root CA ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This config will not proxy the root request…
here is my config:
problem is when I open http://SERVE_DOMAIN:SERVE_PORT (i.e. http://localhost:8080 ) dev server returns:
Cannot GET /
instead of pass proxy to APP_URL
If you want to proxy this request too, you need to pass
index: ''
andcontext
function which return true/false, when server should proxy request.vue-cli don’t allow to pass context function, that’s the problem
EDIT: you can check example here https://webpack.js.org/configuration/dev-server/#devserverproxy search
root proxying
@padinko Solved it this way (for now)
Not the best way but at least it works fine in my case