HAProxy CORS Configuration


I’m trying to look at adding the functionality in this article in with PFsense that is running on an environment. But it seems I’m not able to add the cors.lua file on the server and then add it in the global settings as the doc specifies. I just get an error wherever i put the cors.lua file to say it doesn’t exist (I ssh’d to the firewall and created it with vi).

Enabling CORS in HAProxy - HAProxy Technologies

Has anyone had any experience with this or any other ways to enable within PFSense? I guess I may have to try deploying a server with HAProxy and test it that way if not.

What the the goal of your project?

We’re wanting to send CORS headers back to replies to end users when they are accessing the system.

The system currently hosts multiple web addresses for an application that we redirect on 443.

Sorry if that doesn’t explain it enough.

HAProxy has an “Advanced pass thru” option much like other services in pfsene that allow you to pass parameters not offer in the WebUI. Not sure if that would work or not.

Yes I’ve put it in there as the first step suggests that will go in the global options. It errors and says the file I’ve created doesn’t exist. I’m creating the file via the shell, not sure if there is another way to create it to be read properly?

Not that I know of, probably the best option would be to move to a stand alone instance of HAProxy to get more flexibility.

Ah, have just noticed I can create in the files section under haproxy. That seems to have done it, and also automatically added it to the Global settings in the config file.