Unable to login to my site

i am unable to login, i get the following error (there was an error loading modal)

you can manually append /login to the url to login.

Check the browser developer console to see what error is returned?

XMLHttpRequest cannot load http://investment-economics.in/login. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.investment-economics.in' is therefore not allowed access.

NGINX PLONE5.CONF below. i had changed this today. initially the security headers were active. i have removed them subsequently. l think it may be related to this. further, i am not able to manually login as u suggested.

This adds security headers
#add_header X-Frame-Options "SAMEORIGIN";
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
#add_header X-XSS-Protection "1; mode=block";
#add_header X-Content-Type-Options "nosniff";
#add_header Content-Security-Policy "default-src 'self'; img-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'";
#add_header Content-Security-Policy-Report-Only "default-src 'self'; img-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'";

This specifies which IP and port Plone is running on.

The default is 127.0.0.1:8080

upstream plone {
server 127.0.0.1:8080;
}

Redirect all www-less traffic to the www.site.com domain

(you could also do the opposite www -> non-www domain)

server {
listen 80;
server_name kousalam.com;
rewrite ^/(.) http://www.kousalam.com/$1 permanent;
}
server {
listen 80;
server_name investment-economics.in;
rewrite ^/(.
) http://www.investment-economics.in/$1 permanent;
}

server {

listen 80;
server_name www.kousalam.com;
access_log /var/log/nginx/kousalam.com.access.log;
error_log /var/log/nginx/kousalam.com.error.log;

# Note that domain name spelling in VirtualHostBase URL matters
# -> this is what Plone sees as the "real" HTTP request URL.
# "Plone" in the URL is your site id (case sensitive)
location / {
      proxy_pass http://plone/VirtualHostBase/http/kousalam.com:80/CareerPlanning/VirtualHostRoot/;

}
}

server {

listen 80;
server_name www.investment-economics.in;
access_log /var/log/nginx/investment-economics.in.access.log;
error_log /var/log/nginx/investment-economics.in.error.log;

# Note that domain name spelling in VirtualHostBase URL matters
# -> this is what Plone sees as the "real" HTTP request URL.
# "Plone" in the URL is your site id (case sensitive)
location / {
      proxy_pass http://plone/VirtualHostBase/http/investment-economics.in:80/investmenteconomics/VirtualHostRoot/;
}

}

Update:
I reloaded the site, restarted the server. I am getting the login page vide manual extention /login. So work is done and nothing critical now. Any solution for the ajax loading issue, please let me know.

@vangheem Many Thanks

@vangheem I think there is some serious issue somewhere. I am unable to login, even though I get the login page by manually appending /login. I then logged in through admin password. I changed the password for my regular login by going into the acl_users. However, I am not able to login. Pls help.

I get that error when there is a problem with SSL, ie. my site is at an https:// URL but it's trying to load resources from the http:// URL.

you're using:

server_name www.investment-economics.in;

but have

  proxy_pass http://plone/VirtualHostBase/http/investment-economics.in:80/investmenteconomics/VirtualHostRoot/;

You should be using:

  proxy_pass http://plone/VirtualHostBase/http/www.investment-economics.in:80/investmenteconomics/VirtualHostRoot/;

I made necessary changes and closed the issue. Thanks.