Bug 240374 - Problem with Website - nginx - downloading instead of redirecting
Summary: Problem with Website - nginx - downloading instead of redirecting
Status: Closed Not A Bug
Alias: None
Product: Documentation
Classification: Unclassified
Component: Website (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-doc mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-06 18:46 UTC by Michael Valenta
Modified: 2019-09-20 09:28 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valenta 2019-09-06 18:46:44 UTC
Hello FreeBSD support,

im having a little problem with website. Im using nginx on system FreeBSD 11.2. 

The problem is simple, when i click on any button, it's supposed to redirect me on another site, instead of it, it downloads an index.php and phpinfo, and that's bad, would love your help with fixing my issue as soon as possible, thanks :) 


My nginx config

}

    server {
    server_name mydomain.com www.mydomain.com; # use domain name if you have here
    access_log  /var/log/nginx/1.access.log;
    error_log  /var/log/nginx/1.error.log;
    index index.php index.html index.htm;

    root /web/mydomain.com;
    # php config let nginx talk to php socket
    location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php72-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;  
    
	}
}
Comment 1 Michael Valenta 2019-09-06 19:04:07 UTC
Typed it wrong, the web by itself is alright and index.php or phpinfo starts properly, but when i click on something on my site, it downloads, not redirect
Comment 2 Benedict Reuschling freebsd_committer 2019-09-20 09:28:52 UTC
This is not a bug in FreeBSD itself, it's an nginx configuration issue.
I suggest you look in the FreeBSD Forums for help: https://forums.freebsd.org