This configuration works with multiple virtual hosts, and allows the images for all pages to be in an images directory.
worker_processes 2; # One for each CPU core
error_log logs/main_error.log;
pid logs/nginx.pid;
events { worker_connections 1024; }
http
{ include mime.types;
# i.e. On Windows, [<nginx>/conf/]mime.types
# i.e. the mime.types file in the conf dir in the nginx's directory
default_type application/octet-stream;
index index.htm index.html index.st index.php;
# the file provided when a client asks for a directory
server #default
{ server_name :80;
access_log logs/catchall.access.log;
error_log logs/catchall.error.log;
root html\catchall;
}
server #Server_1
{ server_name Server_1.uk.to ; # *.Server_1.uk.to;
access_log logs/Server_1.access.log;
error_log logs/Server_1.error.log;
root html/Server_1/currentSite;
location ^~ /images/ { alias html/Server_1/images/; }
}
server #Server_2
{ server_name Server_2.uk.to ; # *.Server_2.uk.to;
access_log logs/Server_2.access.log;
error_log logs/Server_2.error.log;
root html/Server_2/currentSite;
location ^~ /images/ { alias html/Server_2/images/; }
}
}
Showing posts with label virtual hosts. Show all posts
Showing posts with label virtual hosts. Show all posts
Tuesday, 5 February 2013
Thursday, 31 January 2013
Stage 2 - Discover nginx data must be in a subdirectory of nginxSet up nginx on Windows virtual hosts for multiple domain names
I next put in multiple virtual hosts.
I made the mistake of referring to the files off in absolute paths elsewhere in the PC
It seemed to work - but only sometimes... The pictures would not appear - or would only appear on the first call. Further web-page requests after that might be text-only, or might just hang forever.
Returning the locations to be subdirectories of the <nginx>/html directory fixed all the problems.
I made the mistake of referring to the files off in absolute paths elsewhere in the PC
It seemed to work - but only sometimes... The pictures would not appear - or would only appear on the first call. Further web-page requests after that might be text-only, or might just hang forever.
Returning the locations to be subdirectories of the <nginx>/html directory fixed all the problems.
Subscribe to:
Posts (Atom)