I moved my magento store from non SSL to SSL (webserver: Nginx)
The problem : The site’s JS scripts ( Multiple Ajax function with “POST” ) has stopped working! Requests are fine but not able to get the response. Response headers (501 B)
I am very much sure this is due to Nginx webserver misconfiguration. Do i need to use reverse proxy to use SSL? If so how? Kindly advise.
My Nginx example.conf looks like this:
server {
listen 189.xx.xx.xx:80;
server_name example.com;
root /home/example/public_html;
index index.html index.php;
return 301 https://example.com$request_uri;
}
& My Nginx ssl-domain.conf looks like this:
server
{
listen 189.xx.xx.xx:443 default ssl;
server_name example.com;
root /home/example/public_html;
index index.html index.php;
ssl on;
ssl_certificate /etc/ssl/example.crt;
ssl_certificate_key /etc/ssl/example.key;
ssl_prefer_server_ciphers on;
location / {
try_files $uri $uri/ /index.php;
expires 30d;
}
location ~* \.(gif|jpg|jpeg|pdf|txt|css|js|png|ico|xml|xml|gz)$ {
access_log off;
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~ \.php$ {
expires off;
fastcgi_read_timeout 900s;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/conf/fastcgi_params;
}
}
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
I just came across this old question.
Looking at your config, it looks like that you have to add $args to your / location:
location / {
try_files $uri $uri/ /index.php?$args;
expires 30d;
}
Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.