We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Nginx Htaccess

https://docs.phalcon.io/en/latest/reference/tutorial.html#beautiful-urls

i was looking for this, but im using nginx webserver. what can i use ? and for use this and INVO tutorails, should I do one of thouse ; https://docs.phalcon.io/en/latest/reference/nginx.html



5.1k

works great. thx



4.5k
edited Mar '14

@ahmeterol: Nginx does NOT support htaccess...

This is what i use, for nginx:

server {
  listen                192.168.56.144:80;

  server_name           phalcon.es www.phalcon.es;
  root /var/www/phalcon.es/public;
    index  index.php index.html index.htm;

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

  location / {
    root  /var/www/phalcon.es/public;
    try_files $request_uri $request_uri/ /index.php$is_args$args;
    index  index.html index.htm index.php;
    gzip on;
  }
  location ~* \.(ico|3gp|gif|jpg|cur|svg|jpeg|png|wmv|avi|asf|asx|mpg|mpeg|mp4|woff|pls|mp3|mid|wav|swf|flv|js|html|htm|txt|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|htc)(\?[0-9]+)?$ {
    access_log off;
    add_header Pragma "public";
    error_log off;
    expires max;
    log_not_found off;
  }

  location ~* \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    try_files $uri =404;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass unix:/var/run/php5-fpm.sock;

    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }

include /etc/nginx/mime.types;
}