Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Configuring Jetty for FastCGI - and pass env. vars to PHP scripts

Hello Simone -


On Tue, Mar 31, 2020 at 11:51 PM Simone Bordet <sbordet@xxxxxxxxxxx> wrote:
What you can do right now is to override this:

class FarberFCGIServlet extends FastCGIProxyServlet {
  protected void customizeFastCGIHeaders(Request proxyRequest,
HttpFields fastCGIHeaders) {
    super.customizeFastCGIHeaders(proxyRequest, fastCGIHeaders);
    fastCGIHeaders.put("COUNTRY", System.getenv("COUNTRY"));
    ...
  }
}


Your suggestion for creating a custom FarberFCGIServlet  - is it to set $_SERVER['COUNTRY'] inside the PHP scripts? Because currently that variable is not there. Or how would I be able to retrieve the fastCGIHeaders from PHP?

And also - how to add the custom FarberFCGIServlet  to the Jetty instances, which are currently being run by the command below?

ExecStart=/usr/bin/java -Djdbc.drivers=org.postgresql.Driver -jar /usr/share/java/jetty-distribution-9.4.27.v20200227/start.jar jetty.home=/usr/share/java/jetty-distribution-9.4.27.v20200227 jetty.base=/var/www/jetty-base-en jetty.http.host=127.0.0.1 jetty.http.port=8082

Best regards
Alex


Back to the top