nginx configuration for amember 4

Discussion in 'Troubleshooting' started by rviyengar, Dec 15, 2012.

  1. rviyengar

    rviyengar New Member

    Joined:
    Jul 3, 2009
    Messages:
    8
    Hi, I am with nginx, I tried the suggestion given in the htaccess file, however, it did not load js/css/ and other required files when I trid to access /amember4/admin, /amember4/signup and many other pages What is the best config in nginx? My config looks like this: server { client_max_body_size 20M; listen 80; server_name example.com www.example.com; access_log /var/www/example/logs/access.log; error_log /var/www/example/logs/error.log; location / { root /var/www/example/public; index index.php index.html; if (!-e $request_filename) { rewrite ^(.+)$ /index.php?q=$1 last; } } ## amember 4 location ~* ^/amem4/.*\.(js|ico|gif|jpg|png|css|swf|csv)$ {try_files not-existing-file @php;} location ~* ^/amem4/setup/index.php$ { try_files not-existing-file @php; } location ~* ^/amem4/js.php { try_files not-exiting-file @php; } location ~* ^/amem4/index.php$ { try_files not-existing-file @php; } location ~* ^/amem4/public.php$ { try_files not-existing-file @php; } location ~* ^/amem4/public { rewrite ^.*$ /amem4/public.php; } location ~* ^/amem4/setup { rewrite ^.*$ /amem4/setup/index.php; } location ~* ^/amem4 { rewrite ^.*$ /amem4/index.php; } location ~ ^(.+\.php)(.*)$ { try_files not-existing-file @php; } ## Parse all .php file in the /var/www directory location @php { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/example/public$fastcgi_script_name; include /etc/nginx/fastcgi_params; } # This block will catch static file requests, such as images, css, js # The ?: prefix is a 'non-capturing' mark, meaning we do not require # the pattern to be captured into $1 which should help improve performance # location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { # # Some basic cache-control for static files to be sent to the browser # expires max; # } ## Disable viewing .htaccess & .htpassword location ~ /\.ht { deny all; } } Any suggestion
  2. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    Sorry but with the entire post contained within a single block of text it would take some time to first decipher what you are saying before even staring to work out what is going wrong.

    Always willing to try helping but at least make it a little easier for the would be responders!

Share This Page