You can find an example in /amember/.htaccess: # Sample Nginx rules configuration: # aMember rules (replace /amember to actual aMember Pro path from site root) # # location ~* ^/amember/.*\.(js|ico|gif|jpg|png|css|swf|csv)$ {} # location ~* ^/amember/setup/index.php$ { try_files not-existing-file @php; } # location ~* ^/amember/js.php { try_files not-exiting-file @php; } # location ~* ^/amember/index.php$ { try_files not-existing-file @php; } # location ~* ^/amember/public.php$ { try_files not-existing-file @php; } # # location ~* ^/amember/public { rewrite ^.*$ /amember/public.php; } # location ~* ^/amember/setup { rewrite ^.*$ /amember/setup/index.php; } # location ~* ^/amember { rewrite ^.*$ /amember/index.php; } # # you must already have something like that in your nginx configuration: # # location ~ \.php$ { # try_files not-existing-file @php; # } # location @php { # fastcgi_pass 127.0.0.1:9000; # include fastcgi_params; # } # # it is necessary to have @php section, as it is referred by aMember rules, and # it must be located at bottom # #
Thank you Alex, I found it, but don't work for me... (internal server error). Do you've some suggestion?
I'm having the same problem. Can somebody post a working nginx config file? Here's what I have now: Code: server { listen xxx.xxx.xxx.xxx:80; server_name test2.mysite.com; access_log /var/log/nginx/access.log main; root /home/mysite/public_html; location ~* ^/amember4/.*\.(js|ico|gif|jpg|png|css|swf|csv)$ {} location ~* ^/amember4/setup/index.php$ { try_files not-existing-file @php; } location ~* ^/amember4/js.php { try_files not-exiting-file @php; } location ~* ^/amember4/index.php$ { try_files not-existing-file @php; } location ~* ^/amember4/public.php$ { try_files not-existing-file @php; } location ~* ^/amember4/public { rewrite ^.*$ /amember4/public.php; } location ~* ^/amember4/setup { rewrite ^.*$ /amember4/setup/index.php; } location ~* ^/amember4 { rewrite ^.*$ /amember4/index.php; } location ~ \.php$ { try_files not-existing-file @php; } location @php { fastcgi_pass 127.0.0.1:9000; include fastcgi_params; } } I get 500 errors on /amember4/index.php . Here's clue from the nginx error log. Code: 2012/02/02 12:27:55 [error] 28780#0: *50 open() "/home/mysite/public_html/application/default/views/public/img/top.png" failed (2: No such file or directory), client: 64.222.159.2, server: test2.mysite.com, request: "GET /application/default/views/public/img/top.png HTTP/1.1", host: "test2.mysite.com", referrer: "http://test2.mysite.com/amember4/setup" These errors show it is looking the document root rather than the /amember4/ directory where the files are uploaded.
Did you fix this? Im having the same problem, except mine is looking in /usr/www/ and ive not even told it to! mine is /var/www/nginx-default
No. I never got it working. The errors weren't being logged on my test server. I haven't had time to go back and troubleshoot it myself yet. If anyone has a working nginx config, I'd love to see it.
Yeah I got it working yesterday: this is what I have below: Code: server { listen 80; server_name elearning-mkupdate.co.uk; access_log /var/log/nginx/localhost.access.log; root /var/www/nginx-default; index index.php index.html; client_max_body_size 50M; client_body_buffer_size 128k; location ~* ^/amember/.*\.(js|ico|gif|jpg|png|css|swf|csv)$ {} location ~* ^/amember/setup/index.php$ { try_files not-existing-file @php; } location ~* ^/amember/js.php { try_files not-exiting-file @php; } location ~* ^/amember/index.php$ { try_files not-existing-file @php; } location ~* ^/amember/public.php$ { try_files not-existing-file @php; } location ~* ^/amember/public { rewrite ^.*$ /amember/public.php; } location ~* ^/amember/setup { rewrite ^.*$ /amember/setup/index.php; } location ~* ^/amember { rewrite ^.*$ /amember/index.php; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # #error_page 500 502 503 504 /50x.html; # location = /50x.html { # root /var/www/nginx-default/; # } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { #proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { try_files not-existing-file @php; } location @php { fastcgi_pass 127.0.0.1:9000; include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME /var/www/nginx-default/$fastcgi_script_name; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } location /phpmyadmin { root /usr/share/; index index.php index.html index.htm; location ~ ^/phpmyadmin/(.+\.php)$ { try_files $uri =404; root /usr/share/; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } } location /phpMyAdmin { rewrite ^/* /phpmyadmin last; } }
I tried the same rules on nginx, but I still receive "File not found.". I changed only the directory from "amember" to "members". Please help :/
I fixed the issue by myself. I have forgot to change the fastcgi_param SCRIPT_FILENAME directory. Sorry!