1

I'm running nginx 1.10.0 on Ubuntu 16.04

Nginx dos not follow symlinks. it even not list the symlink in directory index: enter image description here

as you see in the image wgi is a symlink and it doesn't list in directory index.

and I get 404 error when I check localhost/wgi

here is my nginx.conf:

http {

##
# Basic Settings
##

disable_symlinks off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 5;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# SSL Settings
##

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}

and here is my sites-enabled/default:

server {
listen 80 default_server;
listen [::]:80 default_server;

# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;

root /var/www/html;

autoindex on;

# Add index.php to the list if you are using PHP
index index.html index.htm index.php index.nginx-debian.html;

server_name _;

location / {
    autoindex on;
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ =404;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
    include snippets/fastcgi-php.conf;
#
#   # With php7.0-cgi alone:
    fastcgi_pass 127.0.0.1:9000;
#   # With php7.0-fpm:
#   fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
    deny all;
}
}

I see some solutions about set disable_symlinks to off and symlink permissions but it doesn't work for me.

thanks for your advise.

closed as off-topic by Stephen Kitt, Romeo Ninov, Jeff Schaller, Archemar, Stephen Rauch Aug 2 '17 at 13:23

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Stephen Kitt, Romeo Ninov, Jeff Schaller, Archemar, Stephen Rauch
If this question can be reworded to fit the rules in the help center, please edit the question.

0

I re-install Nginx and now it recognize symlinks

  • It's good to hear that you found the cause of your problem. You could make your answer more helpful for future readers by explaining how you diagnosed it, and in particular, which evidence will identify this problem when it's seen elsewhere. – Toby Speight Aug 2 '17 at 8:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.