frappe / bench

CLI to manage Multi-tenant deployments for Frappe apps
https://frappeframework.com/docs/user/en/bench
GNU General Public License v3.0
1.36k stars 1.19k forks source link

bench setup nginx does not create or link configuration files for sites in /etc/nginx/sites-available/ on Ubuntu 24.04 #1574

Open zeuscs09 opened 1 month ago

zeuscs09 commented 1 month ago

Issue Summary:

The bench setup nginx command does not create the expected configuration file for the domain in /etc/nginx/sites-available/ and fails to link it to /etc/nginx/sites-enabled/.

Steps to Reproduce:

  1. Set up a Frappe Bench environment on Ubuntu 24.04.
  2. Run the command bench setup nginx after adding a site with bench new-site.
  3. Check the /etc/nginx/sites-available/ directory for the generated configuration file.

Expected Behavior:

A configuration file should be generated in /etc/nginx/sites-available/ and linked in /etc/nginx/sites-enabled/ for the added site.

Actual Behavior:

No configuration file is generated, and there is no symbolic link in /etc/nginx/sites-enabled/.

Environment:

Additional Context:

The issue persists even after ensuring correct permissions for the /etc/nginx/ directory. No errors are logged in the bench.log.

phot0n commented 3 weeks ago

you can do it by yourself btw: https://frappeframework.com/docs/user/en/bench/guides/setup-production#nginx

chrisjameslennon commented 2 weeks ago

bench setup nginx on ubuntu 24 fails with

ubuntu@ip-xxx:/etc/nginx/conf.d$ bench setup nginx

ERROR: [Errno 2] No such file or directory: '/etc/nginx/conf.d/sites'
chrisjameslennon commented 2 weeks ago

Also - in regards to the issue raised by @zeuscs09

Expected Behavior: A configuration file should be generated in /etc/nginx/sites-available/ and linked in /etc/nginx/sites-enabled/ for the added site.

is this in fact the expected behaviour? My expectation is that a server block is added to /etc/nginx/conf.d/frappe-bench.conf However I don't think there is any documentation on what is expected with the bench setup nginx command

In any case the command doesn't work