Routes defined in api.php have api prefix defined automatically
Change this
Route::get('/api/mail/send', 'MailController@index');
to this
Route::get('/mail/send', 'MailController@index');
I considered that as well but I still get the 404 when I do this: http://api.mywebsite.com/api/api/mail/send
Even when I created a new route: Route::get('/mailer', 'MailController@index'); and did this I got a 404: http://api.mywebsite.com/mailer
So not sure what I am doing wrong?
If you have your nginx configured correctly for api subdomain (I am not very experienced in nginx) you need to access:
http://api.mywebsite.com/api/mailer
if you have this route inside api.php
Route::get('/mailer', 'MailController@index');
Hmm yeah thats exactly what I have and tried, so I feel it must me my nginx setup which I also do not have experience (first time deploying my laravel api to production). Maybe someone here hass some experience
ah found the problem maybe: root /mywebsite/api/public; should have been root /root/mywebsite/api/public;
But when I do this I new get a 403?
laravel lives in /public whether you use api or not , try mywebsite/public
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community