Jump to content
Froxlor Forum
  • 0

Best approach to configure NGINX WSGI settings for single domain via Froxlor?

Duane Raymond



One of the domains I use needs to run Flask using uWSGI and I'm wondering of the recommended approach to manage the Nginx conf file for this specific domain. I use Froxlor to map the path to the application and generate the Let's Encrypt SSL certificates and I've edited the Froxlor-generated Nginx conf file to remove php-specific include lines and add uWSGI lines, so it all works fine. But I suspect the next time the cron runs that regenerates the scripts, it will be overwrtten. 

So my question is: what is the recommended approach for keeping the custom configuration for this domain as I didn't see any domain-specific field for adding custom Nginx conf lines...or did I miss something?  I've checked the forum responses and feature requests for an answer, but didn't find an answer.

I'm guessing there are a few approaches:

  1. Copy and keep the conf file entirely separate from Froxlor (and somehow prevent it from generating one)
  2. Perhaps add a snippet for the custom configuration to include
  3. I've overlooked a domain-specific custom configuration I can add so Froxlor generates the correct file
  4. something else?

Any guidance would be helpful and appreciated! (chatGPT suggested a solution too, but it seems to have been based on Froxlor < v2)

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
7 minutes ago, d00p said:

have you tried adding your uWSGI lines to the "Own vHost-settings" field of that domain?

I can't find an "Own vHost-settings" for the specific domain (a sub domain)...it is what I was expecting to find it under <customer> -> Domains -> Domain overview -> <my wsgi domain>. - but I don't see an vHost settings there.  I only find them at the level of the top level domain. The top level domain uses PHP while the subdomain has a custom WSGI app. 

I also checked if I missed allowing domain level vhost settings at the admin level, but also didn't find an option for that, although I did see the "Own vHost-settings" at the TLD level.  I'm concerned if I add the WSGI settings at the TLD level that it will break the PHP config of that site when I need it just to apply to the subdomain. (when I first posted, I didn't realised the TLD had more options than the subdomain)

Link to comment
Share on other sites

  • 0

Super - that seems to have worked!

Once I set the subdomain as having no parent and set the "Own vHost settings" to be like:

location / {
      # Configure the location of the uWSGI server
       include uwsgi_params;
       uwsgi_pass unix:///var/customers/webs/<customer dir>/<app folder>/myapp.sock;

The webserver config regeneration script recognised the custom root location setting was part of root and merged it into the standard root location configuration...and everything works fine now.

Thanks for your guidance on this and hopefully this post helps others implement wsgi apps into their domains / subdomains.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...