我目前有以下代码。我想知道即使我转到http://localhost/dog之类的其他页面,是否仍然可以提供此根服务。我下面的命令的问题是它将返回404
server {
listen 80;
server_name localhost;
location / {
root /usr/src/app/angularjs/dist;
}
}
答案 0 :(得分:3)
有可能。将def send_email(subject, message, receivers):
msg = email.message.Message()
sender = "mydomain.com"
msg["Subject"] = subject
msg["From"] = sender
msg["To"] = ", ".join(receivers)
msg.add_header('Content-Type', 'text')
msg.set_payload(message)
smtpObj = smtplib.SMTP("thats.not.cheddar")
smtpObj.sendmail(msg["From"], msg["To"], msg.as_string())
smtpObj.quit()
指令添加到您的try_files
块中,这将告诉Nginx使用您的location
加载所有无法与文件系统路径匹配的请求:
index.html