as mentioned, I want to show my static page on port 80.
below / var/www/blog
is the configuration file of my static resource
nginx / etc/nginx/cond.f/blog.conf
. I wrote this
server {
listen 80;
location / {
root /var/www/blog;
}
}
but after restarting nginx, it is found that the website reports 404, but changing the port to 8080 can access the static resource.
Thank you for your advice on how to configure it. Thank you
nginx.conf
for your advice. The configuration is as follows
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
-sharp multi_accept on;
}
http {
-sharp-sharp
-sharp Basic Settings
-sharp-sharp
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
-sharp server_tokens off;
-sharp server_names_hash_bucket_size 64;
-sharp server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
-sharp-sharp
-sharp SSL Settings
-sharp-sharp
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; -sharp Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
-sharp-sharp
-sharp Logging Settings
-sharp-sharp
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
-sharp-sharp
-sharp Gzip Settings
-sharp-sharp
gzip on;
gzip_disable "msie6";
-sharp gzip_vary on;
-sharp gzip_proxied any;
-sharp gzip_comp_level 6;
-sharp gzip_buffers 16 8k;
-sharp gzip_http_version 1.1;
-sharp gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
-sharp-sharp
-sharp Virtual Host Configs
-sharp-sharp
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
-sharpmail {
-sharp -sharp See sample authentication script at:
-sharp -sharp http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
-sharp
-sharp -sharp auth_http localhost/auth.php;
-sharp -sharp pop3_capabilities "TOP" "USER";
-sharp -sharp imap_capabilities "IMAP4rev1" "UIDPLUS";
-sharp
-sharp server {
-sharp listen localhost:110;
-sharp protocol pop3;
-sharp proxy on;
-sharp }
-sharp
-sharp server {
-sharp listen localhost:143;
-sharp protocol imap;
-sharp proxy on;
-sharp }
-sharp}