Submitted by aitte on Mon, 02/11/2013 - 15:51
here is what I did:
install nginx module
edit module config to set sites-enabled/sites-active paths
go to "nginx webserver -> other settings"
try to set "number of worker processes" to 4.
when I apply that config, nginx refuse to start... when I look in the config I see virtualmin has destroyed config ;)
destroyed:
user nginx;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
what it should be:
user nginx;
worker_processes 4;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
server_names_hash_bucket_size 128;
}
please fix... not good that it eats config for breakfast! :P
Status:
Closed (fixed)
Comments
Submitted by aitte on Mon, 02/11/2013 - 16:00 Comment #1
try it on fresh system with this install proces:
then go to module config and set it to use sites-enabled/available paths, and save.
then go and try to set the worker connections. boom, cookie monster eats config! :P
Submitted by JamieCameron on Mon, 02/11/2013 - 19:15 Comment #2
Could you attach the original and corrupt configs to this bug report, or email them to me as attachments at jcameron@virtualmin.com ? Otherwise their format gets messed up by the bug tracker..
Submitted by aitte on Mon, 02/11/2013 - 23:31 Comment #3
the 2 configs above are actually correct, they did not get changed at all by the bug tracker...
i have only the correct config on my server now so i cant attach both, and the correct config is useless to show anyway because it works now and can be edited fine by virtualmin... (after i fixed it in vim)
either way i dont have the most interestig thing of them all... the default config before it was eaten by virtualmin.
its possible the bug only happens with official nginx default config file. if you have a blank vm you can do the steps in post 2 and its exactly what i did.
looking at the above it seems virtualmin eats 2 lines after "worker_processes 4;" and eats 2 lines after "default_type application/octet-stream;"
look carefully, its very interesting that exactly 2 lines are missing below each "eaten" / edited part... and think about it... both "worker_processes" and "default_type" are changed from "other settings" in nginx module which is where i pressed save and config broke, so it proves that virtualmin edited both... and you can see extra indent of "default_type" line after virtualmin edit(changes 4 spaces to 1 tab after editing a value)...
so yes this is totally virtualmins fault ;) it is hungry for config file breakfast. :D
Submitted by JamieCameron on Tue, 02/12/2013 - 00:28 Comment #4
Ok, I see the issue .. Virtualmin isn't handling multi-line directives with continuations.
I'll need to make some changes to handle this.
Submitted by aitte on Tue, 02/12/2013 - 00:45 Comment #5
hmm, okay good, hope you find the bug! :)
Submitted by JamieCameron on Thu, 02/14/2013 - 00:54 Comment #6
Ok, I found the bug .. this will be fixed in the next release of the Nginx plugin to virtualmin.
Submitted by aitte on Thu, 02/14/2013 - 10:57 Comment #7
wohoo! :D great work
Submitted by Issues on Thu, 02/28/2013 - 11:02 Comment #8
Automatically closed -- issue fixed for 2 weeks with no activity.