Replies: 1 comment
-
const app = express();
app.use((req, res, next) => {
res.setHeader('X-Frame-Options', 'SAMEORIGIN');
res.setHeader('X-XSS-Protection', '1; mode=block');
res.setHeader('X-Content-Type-Options', 'nosniff');
next();
});
app.use('/adminer', createProxyMiddleware({
target: 'your server url',
pathRewrite: {
'^/adminer': '',
},
on: {
proxyReq: (proxyReq, req, res) => {
proxyReq.setHeader('X-Forwarded_For', req.connection.remoteAddress);
proxyReq.setHeader('Host', 'your server url');
},
},
changeOrigin: true,
followRedirects: false,
}));I hope this can be helpful to you |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I need to transfer a proxy nginx config to use this express
http-proxy-middlewarebut unfortunately Idk how exactly to do it.This below is an excerpt of my
nginx.confWhat would I alll need to configure an equivalent
createProxyMiddleware()Really appreciating any help! TIA.
Beta Was this translation helpful? Give feedback.
All reactions