Wedge

Public area => Documentation => Topic started by: Pandos on January 31st, 2014, 11:19 AM

Title: PrettyURLs on nginx
Post by: Pandos on January 31st, 2014, 11:19 AM
Setup PrettyURls for nginx is straight forward.
It's the same setup as for Wordpress.
Thanks to MultiformeIngegno
Code: [Select]
server {
   server_name .DOMAIN.TLD;
   index index.php;
   root /var/www/WEDGE_INSTALLATION_DIR;

   error_log /var/www/WEDGE_INSTALLATION_DIR/error.log;
   
   #Specify a charset
   charset utf-8;
   
   location / {
      try_files $uri $uri/ /index.php?$args;
   }

   location ~ \.php$ {
      try_files $uri =404;
      fastcgi_split_path_info ^(.+\.php)(/.+)$;
      fastcgi_read_timeout 180;
      include fastcgi.conf;
      fastcgi_pass unix:/var/run/php5-fpm.sock;
   }
   
   ## Deny dot files:
   location ~ /\. {
      deny all;
   }

   ## favicon.ico not found
   location = /favicon.ico {
      access_log off;
      log_not_found off;
   }

   ## robots.txt not found
   location = /robots.txt {
      access_log off;
      log_not_found off;
   }

}
Title: Re: PrettyURLs on nginx
Post by: Nao on February 1st, 2014, 12:11 AM
Is it worth including the '.ht' lines, considering dot-folders were forbidden altogether in the rule before..?
Title: Re: PrettyURLs on nginx
Post by: Pandos on February 1st, 2014, 02:03 AM
I don't think so.
First rule should be enough....
Title: Re: PrettyURLs on nginx
Post by: MultiformeIngegno on February 1st, 2014, 02:18 AM
True!
Title: Re: PrettyURLs on nginx
Post by: Pandos on February 1st, 2014, 02:37 AM
Changed :)
Title: Re: PrettyURLs on nginx
Post by: Joannah01 on October 29th, 2018, 03:19 AM
Quote from Pandos on January 31st, 2014, 11:19 AM
Setup PrettyURls for nginx is straight forward.
It's the same setup as for Wordpress.
Thanks to MultiformeIngegno
Code: [Select]
server {
   server_name .DOMAIN.TLD;
   index index.php;
   root /var/www/WEDGE_INSTALLATION_DIR;

   error_log /var/www/WEDGE_INSTALLATION_DIR/error.log;
   
   #Specify a charset
   charset utf-8;
   
   location / {
      try_files $uri $uri/ /index.php?$args;
   }

   location ~ \.php$ {
      try_files $uri =404;
      fastcgi_split_path_info ^(.+\.php)(/.+)$;
      fastcgi_read_timeout 180;
      include fastcgi.conf;
      fastcgi_pass unix:/var/run/php5-fpm.sock;
   }
   
   ## Deny dot files:
   location ~ /\. {
      deny all;
   }

   ## favicon.ico not found
   location = /favicon.ico {
      access_log off;
      log_not_found off;
   }
Rachat de crédit
   ## robots.txt not found
   location = /robots.txt {
      access_log off;
      log_not_found off;
   }

}
It's so complicated
Title: Re: PrettyURLs on nginx
Post by: Nao on January 29th, 2019, 12:13 PM
Lol, another creative spammer... I'm guessing, same guy.