Utilisation de PluXml avec Nginx
On installe le paquet Nginx, et pour php le paquet php-fpm
pacman -S nginx php-fpm
Pour php on crée le fichier /etc/nginx/php.conf
location ~ \\.php$ {
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ /\\.ht {
deny all;
}
On modifie le fichier /etc/nginx/nginx.conf pour faire pointer notre serveur sur l'installation de pluxml (dans mon cas /srv/http/pluxml)
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
include php.conf;
server_name wxproject.com www.wxproject.com;
root /srv/http/pluxml;
index index.php index.html index.htm;
# Ici des lignes de configuration à ne pas toucher...
# On cache le fichier version:
location /version {
return 404;
}
# Ligne très importante pour éviter le vol de mot de passe
location ^~ /data/configuration/ {
deny all;
}
# Optional: set long EXPIRES header on static assets
location ~* ^.+\\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires 30d;
# Optional: Don't log access to assets
access_log off;
}
if (-f $request_filename) {
break;
}
if (!-e $request_filename) {
rewrite ^/([^feed\\/].*)$ /index.php?$1 last;
rewrite /feed\\/(.*)$ /feed.php?$1 last;
break;
}
}
}
On active Nginx et Php-fpm et on démarre les services
systemctl enable php-fpm.service
systemctl enable nginx.service
systemctl start php-fpm.service
systemctl start nginx.service