Skip to content

Instantly share code, notes, and snippets.

@priatmoko
priatmoko / gist:f6fd3edbb781609a85aaf7437a1cb04e
Last active July 16, 2019 02:07
Laravel Xampp Apache Sub-directory
#the configuration on apache configuration
#you can find the configuration on
#C:\xampp\apache\conf\httpd.conf
<Directory "C:/xampp/htdocs/apps/public">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
Alias "/apps" "C:/xampp/htdocs/apps/public"
@priatmoko
priatmoko / gist:fb8bbe3ad16e5f9c1eb604fa722811b9
Created July 16, 2019 02:01
auto redireact http to https using htaccess
#Your common configuration
#bellow of your common configuration add this code
RewriteCond %{HTTPS} off
RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@priatmoko
priatmoko / gist:490e9ee4303e857bbba51ee27f262c40
Last active March 28, 2019 03:53
Nginx configuration for laravel - adding special characters at the end of js file
Developing web app using vagrant is awesome. It make us ease to switch between one environtment to other.
But sometimes there are strange thing.In my case, I develope web application using laravel in
vagrant environtment (xenial ubuntu server and nginx). In half of development i found something strange.
My javascripts file didn't update directly when I change and there is special characters at the end of javascript.
After googling for hours, I got the solution.
Here is the solution.
1. Find nginx configuration /etc/nginx/nginx.conf
2. Open the file nginx.conf and find 'sendfile on' configuration, change it to sendfile off;
Find the screeenshoot on comment part.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@priatmoko
priatmoko / laravel-nginx-sub-directory-conf
Last active December 26, 2018 06:21
NginX Configuration for removing public and index, laravel in sub directory
#The are a lot of methods to separate configuration of laravel in nginx. It is only one of them but not the best.
#Configuration for removing public and index in laravel or lumen that run on nginX
#This configuration implemented in ubuntu server
#We can copy this code directly to "/etc/nginx/site-enabled/default"
#or you can separate this file, to reduce complexity / large code in file "/etc/nginx/site-enabled/default"
#directory name
location /dir {
#we point the alias to the lavel public directory