Articles of laravel

Nginx反向代理与Laravel的WordPress

我目前正在pipe理一个设置,在domain.com上使用Laravel webapp并在domain.com/blog上运行一个Wordpress博客。 domain.com/blogpath代理到Wordpress博客所在的另一台服务器。 build立 服务器1 基于Laravel运行webapp的nginx webserver: server { listen 80; server_name default.com; return 301 https://www.default.com$request_uri; } server { listen 443; ssl_certificate /etc/letsencrypt/live/www.default.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/www.default.com/privkey.pem; server_name default.com; return 301 https://www.default.com$request_uri; } server { listen 443 ssl; listen [::]:443 ssl ipv6only=on; root /var/www/html/default/current/public; index index.php index.html index.htm; server_name www.default.com; error_log /var/log/nginx/www.default.com.error.log debug; location / { try_files […]

Nginx的。 Laravel。 如何在子文件夹中设置多个端点

我有这样的项目结构 <root>/public/laravel_app/index.php — Laravel index file <root>/public/index.php — CraftCMS index file 我想加载CraftCMS应用程序 https://<domain> 和https://<domain>/laravel_app Laravel应用程序 这是我的vhost.conf server { listen 443 ssl; index index.php index.html; root /var/www/public; ssl_certificate /var/www/docker/certs/nginx.crt; ssl_certificate_key /var/www/docker/certs/nginx.key; location / { try_files $uri /index.php?$args; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass app:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; […]

403禁止在laravel项目,但没有别的

我有一个数字海洋液滴,我有一个testing页的网站的根,它工作得很好,但是当我试图连接到laravel项目,它击中我403 Forbidden错误。 基本上如果我去: mysite.com/ 它显示正常页面 如果我去: mysite.com/public 它显示了我的403 error 。 我试图改变权限使用chmod -R 755 app/storage甚至试图改变整个文件夹/目录的权限,没有任何作品。 这是错误日志的最后一部分: 2014/12/22 11:13:02 [error] 14447#0: *1 directory index of "/var/www/mysite.com/public_html/" is forbidden, client: 41.150.139.252, server: mysite.com, request$ 2014/12/22 11:13:07 [error] 14447#0: *2 directory index of "/var/www/mysite.com/public_html/" is forbidden, client: 41.150.139.252, server: mysite.com, request$ 2014/12/22 11:15:29 [emerg] 14465#0: bind() to 0.0.0.0:80 failed […]

403在Laravel Homestead安装上的禁止nginx / 1.6.2

我不知道我能做些什么来完成我的Laravel Homestead安装。 一些信息: laravel / homestead(virtualbox,0.2.4) stream浪基地很清醒32。 我不能在SSH中使用serve命令。 这是我的家园.yaml: — ip: "192.168.10.10" memory: 2048 cpus: 1 authorize: ~/.ssh/id_rsa.pub keys: – ~/.ssh/id_rsa folders: – map: /Users/bolos/base to: /home/vagrant/base sites: – map: homestead.app to: /home/vagrant/base/homestead/public databases: – homestead variables: – key: APP_ENV value: local provider: virtualbox # blackfire: # – id: foo # token: bar 我不知道我还能提供什么帮助,但随时可以问。 先谢谢你。

Laravel 5和Cloudflare SSL

那么,今天我第一次决定在我的web项目上使用ssl 。 首先,我在cloudflare.com中configuration了我的域名。 然后,我打开了cloudflare中的页面规则,自动将网站redirect到https。 http://*example.com/* 为了确保它的工作,我添加了简单的index.php到public_html,它的工作。 我的意思是,当我进入网站时, https是活跃的,网站上显示了我的名字:“Hello World” 之后,我将我的Laravel项目上传到Web服务器并configuration了虚拟主机。 我使用nginx服务器。 server { listen 80; root /home/user/www/example.com/public_html/public; index index.php index.html index.htm; server_name example.com location / { try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info […]

在Ubuntu中,使用nginx和php7.0-fpm的Laravel 5.4的502错误网关

我有我的Laravel 5.4应用程序安装在Ubuntu 16.04服务器与nginx和php7.0-fpm ,它给 502 Bad Gateway Nginx的虚拟主机configuration, server { listen 80; ## listen for ipv4; this line is default and implied #listen [::]:80 default ipv6only=on; ## listen for ipv6 root /var/www/html/laravel/public; index index.php index.html; # Make site accessible from http://localhost/ server_name localhost; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { […]

502当运行默认的laravel应用程序,而其他的PHP文件工作时,网关不好

我试图安装laravel(尝试5和4),但我不断得到一个502错误的网关错误。 在网上search导致了一些关于unix-socket错误权限的答案。 但我的PHP使用完全相同的参数function的其他域设置function,你所期望的。 这是通过干净安装框架后的设置/configuration /data/$ laravel new myapp nginxconfiguration: server { listen 80; root /data/myapp/public/; index index.php index.html index.htm; server_name example.net; location / { try_files $uri $uri/ index.php?$query_string; } location ~ \.php$ { try_files $uri /index.php =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } ls -ahl /var/run/php5-fpm.sock srw-rw—- 1 […]

stream明+ nginx =错误500,重写或内部redirect周期,同时在内部redirect到“/index.php”

我试图设置stream明 – 在Laravel的组件之上构build的“微观框架”。 在服务器端有nginx + php-fpm。 这是我的nginxconfiguration: server { server_name lumen.dev; root /var/www/lumen; location / { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_NAME /index.php; fastcgi_param SCRIPT_FILENAME /var/www/lumen/public/index.php; try_files $uri $uri/ /index.php?$query_string; } } 这个configuration工作正常,当我调用定义的路线,例如我看到“stream明”。 回应时打开http://lumen.dev 。 但是,当我尝试打开像http://lumen.dev/404未定义的路线,我在浏览器中看到“500内部服务器错误”,此消息在nginx错误日志中: 重写或内部redirect周期,而内部redirect到“/index.php”,客户端:127.0.0.1,服务器:lumen.dev 我怎样才能修复我的nginx conf使它工作?

Laravel 5.3,使用api.example.com到example.com/api

如何将api.example.com路由到example.com/api,以便我可以 api.example.com/v1/users 比使用 example.com/api/v1/users. 我正在使用nginx,谢谢。

Laravel使浏览器呈现dynamic图像

我正在使用dynamic图像生成器simple-qrcode 。 它工作正常,因为img src 。 但是,当我尝试直接访问, 例如 site.dev/qr/some-text/60 ,从客户端的地址栏的图像,它返回的编码文本不是图像。 以下是操作方法: public function qr($txt='None',$size=32) { return QrCode::format('png')->size($size)->generate(urldecode($txt)); } 以下是web.php的路由: Route::get('/generator/qr/{txt?}/{size?}', 'GeneratorController@qr')->where(['txt', '(.*)/']); 我试图添加.png希望浏览器认为它是一个图像,即site.dev/qr/some-text/60/qr.png ,路由,但它不工作,如下所示: Route::get('/generator/qr/{txt?}/{size?}/qr.png', 'GeneratorController@qr')->where(['txt', '(.*)/']); 该应用程序使用PHP7.1.3作为fastcgi在Nginx 1.10.3 / Windows10 64位上运行。 以下是Nginx的虚拟主机设置: server { listen 80; server_name site.dev; location /{ root C:/Users/Said/Desktop/Project/laravel/site/public; index index.php index.html index.htm; try_files $uri $uri/ /index.php?$query_string; } error_page 404 /404.html; error_page […]