aios
(Dave)
July 9, 2016, 3:30am
1
I want make another port to php fastcgi_pass based on some “if” like
upstream http_backend1 {
server 127.0.0.1:9000;
}
upstream http_backend2 {
server 127.0.0.1:9001;
}
...
location ~ \.php {
....
fastcgi_pass http_backend1;
if ($http_x_forwarded_proto = "http") {
fastcgi_pass http_backend2;
}
...
}
...
It can be possible with Caddy/
abiosoft
(Abiola Ibrahim)
July 9, 2016, 5:28am
2
Something like this can work. I think rewrite suits this better since the redirection is internal and not exposed to the user.
proxy /http_backend 127.0.0.1:9001
rewrite {
if {path} ends_with .php
if {scheme} is http
to /http_backend
}
1 Like
aios
(Dave)
July 9, 2016, 7:11am
3
Great! If i want to use jwt token custom claim for variable in {sheme}?
abiosoft
(Abiola Ibrahim)
July 9, 2016, 7:20am
4
There is no JWT plugin for Caddy yet but you can access any header via {>Header}
e.g. {>User-Agent}
.
Check the documentation for placeholders to see all supported ones.
matt
(Matt Holt)
July 9, 2016, 2:12pm
6
There’s this one - unless you were talking about something else?
2 Likes
aios
(Dave)
July 9, 2016, 6:18pm
7
I cant return any variable in this plugin. But can make some restrictions what return true or false. I need get custom claim from token and use that for my conditions of proxy.
system
(system)
Closed
October 7, 2016, 6:18pm
8
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.