Reputation: 21877
I have two paths:
/etc/nginx/sites-enabled /opt/nginx/conf/nginx.conf
Both contain an .conf file, is it possible I have nginx installed in two locations? When I edit the first /etc/ conf file, I can control what is served, it appears the /opt conf file is ignored. Why?
conf 1:
server {
listen 80;
server_name www.mydomain.com;
access_log /var/www/mydomain/logs/access.log;
root /var/www/mydomain/;
index me.html me.js;
}
~
conf 2 (ignored at /opt/nginx/conf/nginx.conf
events {
worker_connections 1024;
}
http {
passenger_root /usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11;
passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.3-p0/ruby;
include 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 logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name www.mydomain.com;
root /var/www/hello/releases/current/public/;
passenger_enabled on;
}
server {
listen 80;
server_name localhost;
Upvotes: 0
Views: 229
Reputation: 2062
No, you only have one installation.
/opt/local/nginx/conf is where the base configuration for the nginx server is.
/etc/nginx/sites-enabled is where you'd symlink site you want to be active (from /etc/nginx/sites-available.
/etc/nginx/sites-available should contain the individual conf files for virtual hosts.
There should be one file in the sites-available folder (if you haven't added any more). That will be the one being used. It may not be named ending .conf
Upvotes: 1