Search code examples
javaapache2ubuntu-16.04wildfly-10

How to add to apache or wildfly X-Forwarded-For?


I probably don't understand details of http/https communication. I have java aplication working on wildfly and apache. I need to set X-Forwarded-For as default header send by rest api from client to server.I don't know how. Should I need to change something on wildfly or apache configuration?


Solution

  • You can use apache mod_header to set/change headers:

    Header set MyHeader "Hello Joe. It took %D microseconds for Apache to serve this request."
    

    Official documentation: https://httpd.apache.org/docs/current/mod/mod_headers.html