405 Not Allowed

felipesmendes nginx-forum at forum.nginx.org
Tue Mar 8 15:18:57 UTC 2022


Hello Sergey,

I did what you told, update to nginx (1.16.1-0+xenial1).

And here is the config of server:

# The server directive says Nginx that this is a new server configuration
server {
        # This has to be the domain you want to use
        server_name webdav.inoprime.com.br;
        # This is the document root
        root /var/www/html/webdav/;
        # This is the file which gets loaded by default. index.html gets
loaded if there is no index.php
        index index.php index.html server.php;

        access_log /var/log/nginx/webdav.access.log;
        error_log /var/log/nginx/webdav.error.log error;
	#proxy_buffering on;
	#proxy_request_buffering on;
        # This configuration prevent the logger to log not found favicon
        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }

        # Same as favicon but for robots.txt
        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }

        # This says the Nginx server to rewrite any requests which do not
access a valid file to rewrite on to the index.php
        location / {
                try_files $uri $uri/ /server.php?$args;
        }

        # This gets all requests from the location above and sends them to
the php-fpm socket which will execute the php
        location ~ \.php$ {
                include fastcgi.conf;
                fastcgi_intercept_errors on;
                fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
                fastcgi_pass unix:/run/php/php5.6-fpm.sock;
                fastcgi_read_timeout 600;
        }

        # This says that all files with the given endings should be cached
by the client
        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                expires max;
                log_not_found off;
        }





    listen 443 ssl; # managed by Certbot
    ssl_certificate
/etc/letsencrypt/live/webdav.inoprime.com.br/fullchain.pem; # managed by
Certbot
    ssl_certificate_key
/etc/letsencrypt/live/webdav.inoprime.com.br/privkey.pem; # managed by
Certbot
#    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
#    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


}

server {


    if ($host = webdav.inoprime.com.br) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


        server_name webdav.inoprime.com.br;
    listen 80;
    return 404; # managed by Certbot


}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293805,293807#msg-293807



More information about the nginx mailing list