February 2018
Beginner to intermediate
348 pages
9h 40m
English
Finally, set up your location blocks—directives that apply to specific locations on your site:
# The following applies to static files: # images, CSS, javascript location ~* ^.+.(jpg|jpeg|png|gif|ico|css|js)$ { access_log off; # Disable logging # Allow client browsers to cache files # for a long period of time expires 180d; } # The following applies to every request location / { # Try serving the requested URI: # - If the file does not exist, append / # - If the directory does not exist, # redirect to /index.php forwarding the request URI # and other request arguments try_files $uri $uri/ /index.php?q=$uri&$args; } # The following applies to every PHP file location ~ .php$ { # Ensure file really exists if (!-e $request_filename) ...Read now
Unlock full access