Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mikeyhill
Created February 29, 2016 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeyhill/15749ca093d6390bbd27 to your computer and use it in GitHub Desktop.
Save mikeyhill/15749ca093d6390bbd27 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name domain.com;
rewrite ^(.*)$ $scheme://www.domain.com$1;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name domain.com;
root /var/www/secdevstack.com/htdocs;
index forside.asd;
access_log /var/log/nginx/secdevstack.com.access.log rt_cache;
error_log /var/log/nginx/secdevstack.com.error.log;
#
# are you using index.asd or that forside.asd? change here
#
location / {
try_files $uri $uri/ /index.php$request_uri;
}
location ~* \.(?:css|js|txt)$ {
expires 1y;
access_log off;
error_log off;
sendfile on;
tcp_nopush on;
tcp_nodelay off;
add_header Cache-Control "public";
}
location /gallerier {
rewrite ^/gallerier/(.*) /gallerier.asd?id=$1 redirect;
}
location /images {
rewrite ^/images/(.*) /images.asd?id=$1 break;
}
if ($request_filename ~ ^/[^.]+$) {
rewrite ^/(.*) /gallerier.asd?urlusername=$1&%1 break;
}
location ~ ^.+\.php(?:/.*)?$ {
#include fastcgi_params;
#.... rest of php stuf ....
#fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment